bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def __bobo_traverse__(self, REQUEST, name): product=self.aq_acquire('_getProducts')()._product(name) dispatcher=FactoryDispatcher(product, self.aq_parent, REQUEST) return dispatcher.__of__(self)
def __bobo_traverse__(self, REQUEST, name): product=self.aq_acquire('_getProducts')()._product(name) dispatcher=FactoryDispatcher(product, self.aq_parent, REQUEST) return dispatcher.__of__(self)
1,600
def manage_addZSearch(self, report_id, report_title, report_style, input_id, input_title, queries=[], REQUEST=None): 'add a report' if not queries: raise ValueError, ( 'No <em>searchable objects</em> were selected') if not report_id: raise ValueError, ( 'No <em>report id</em> were specified') if input_title and not ...
def manage_addZSearch(self, report_id, report_title, report_style, input_id, input_title, queries=[], REQUEST=None): 'add a report' if not queries: raise ValueError, ( 'No <em>searchable objects</em> were selected') if not report_id: raise ValueError, ( 'No <em>report id</em> were specified') if input_title and not ...
1,601
def manage_upload(self,file='', REQUEST=None): """Replace the contents of the document with the text in file.""" self._validateProxy(REQUEST) self.munge(file.read()) if REQUEST: return MessageDialog( title ='Success!', message='Your changes have been saved', action ='manage_main')
def manage_upload(self,file='', REQUEST=None): """Replace the contents of the document with the text in file.""" self._validateProxy(REQUEST) if type(file) is not type(''): file=file.read() self.munge(file) if REQUEST: return MessageDialog( title ='Success!', message='Your changes have been saved', action ='manage_mai...
1,602
def _init_headers(self, request, response): # Attempt to handle If-Modified-Since headers. ms=request.get_header('If-Modified-Since', None) if ms is not None: ms=string.split(ms, ';')[0] ms=DateTime(ms).timeTime() if self.lmt > ms: RESPONSE.setStatus(304) return RESPONSE response.setHeader('Content-Type', self.content_...
def _init_headers(self, request, response): # Attempt to handle If-Modified-Since headers. ms=request.get_header('If-Modified-Since', None) if ms is not None: ms=split(ms, ';')[0] ms=DateTime(ms).timeTime() if self.lmt > ms: RESPONSE.setStatus(304) return RESPONSE response.setHeader('Content-Type', self.content_type) r...
1,603
def manage_exportObject(self, id='', download=None, toxml=None, RESPONSE=None): """Exports an object to a file and returns that file.""" if not id: # can't use getId() here (breaks on "old" exported objects) id=self.id if hasattr(id, 'im_func'): id=id() ob=self else: ob=self._getOb(id)
def manage_exportObject(self, id='', download=None, toxml=None, RESPONSE=None): """Exports an object to a file and returns that file.""" if not id: # can't use getId() here (breaks on "old" exported objects) id=self.id if hasattr(id, 'im_func'): id=id() ob=self else: ob=self._getOb(id)
1,604
def manage_importObject(self, file, REQUEST=None, set_owner=1): """Import an object from a file""" dirname, file=os.path.split(file) if dirname: raise 'Bad Request', 'Invalid file name %s' % file
def manage_importObject(self, file, REQUEST=None, set_owner=1): """Import an object from a file""" dirname, file=os.path.split(file) if dirname: raise 'Bad Request', 'Invalid file name %s' % file
1,605
def manage_importObject(self, file, REQUEST=None, set_owner=1): """Import an object from a file""" dirname, file=os.path.split(file) if dirname: raise 'Bad Request', 'Invalid file name %s' % file
def manage_importObject(self, file, REQUEST=None, set_owner=1): """Import an object from a file""" dirname, file=os.path.split(file) if dirname: raise 'Bad Request', 'Invalid file name %s' % file
1,606
def manage_help(self, RESPONSE, SCRIPT_NAME): "Help!" RESPONSE.redirect(SCRIPT_NAME+'HelpSys/hs_index') return ''
def manage_help(self, RESPONSE, SCRIPT_NAME): "Help!" RESPONSE.redirect(SCRIPT_NAME+'/HelpSys/hs_index') return ''
1,607
def filtered_manage_options( self, REQUEST=None, help_option_=({'label': 'Help', 'action': 'manage_help'},), ): if REQUEST is None: if hasattr(self, 'REQUEST'): REQUEST=self.REQUEST try: user=REQUEST['AUTHENTICATED_USER'] except: user=None result=[] seen_roles={}
def filtered_manage_options( self, REQUEST=None, help_option_=({'label': 'Help', 'action': 'manage_help', },), ): if REQUEST is None: if hasattr(self, 'REQUEST'): REQUEST=self.REQUEST try: user=REQUEST['AUTHENTICATED_USER'] except: user=None result=[] seen_roles={}
1,608
def _setupDBs(self): # Data Type Assumptions: # # - Object ids (oid) are 8-bytes # - Objects have revisions, with each revision being identified by a # unique serial number. We sometimes refer to 16-byte strings of # oid+serial as a revision id. # - Transaction ids (tid) are 8-bytes # - Version ids (vid) are 8-byt...
def _setupDBs(self): # Data Type Assumptions: # # - Object ids (oid) are 8-bytes # - Objects have revisions, with each revision being identified by a # unique serial number. We sometimes refer to 16-byte strings of # oid+serial as a revision id. # - Transaction ids (tid) are 8-bytes # - Version ids (vid) are 8-byt...
1,609
def _docommit(self, txn, tid): self._pending.put(self._serial, COMMIT, txn) # Almost all the data's already written by now so we don't need to do # much more than update reference counts. Even there, our work is # easy because we're not going to decref anything here. deltas = {} co = cs = None try: co = self._oids.cur...
def _docommit(self, txn, tid): self._pending.put(self._serial, COMMIT, txn) # Almost all the data's already written by now so we don't need to do # much more than update reference counts. Even there, our work is # easy because we're not going to decref anything here. deltas = {} co = cs = None try: co = self._oids.cur...
1,610
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stu...
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stu...
1,611
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stu...
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stu...
1,612
def setHeader(self, name, value): self.headers[n]=value
def setHeader(self, name, value): self.headers[n]=value
1,613
def getUserById(self, id, default=_marker): """Return the user corresponding to the given id. """ # The connection between getting by ID and by name is not a strong # one try: result=self.getUser(id) return result.__of__(self) # Wrap in our context except: if default is _marker: raise return default
def getUserById(self, id, default=_marker): """Return the user corresponding to the given id. """ # The connection between getting by ID and by name is not a strong # one try: return self.getUser(id) # Wrap in our context except: if default is _marker: raise return default
1,614
def manage_addFile(self,id,file='',title='',precondition='', content_type='', REQUEST=None): """Add a new File object. Creates a new File object 'id' with the contents of 'file'""" id, title = cookId(id, title, file) self=self.this() # First, we create the file without data: self._setObject(id, File(id,title,'',con...
def manage_addFile(self,id,file='',title='',precondition='', content_type='', REQUEST=None): """Add a new File object. Creates a new File object 'id' with the contents of 'file'""" id, title = cookId(id, title, file) self=self.this() # First, we create the file without data: self._setObject(id, File(id,title,'',con...
1,615
def __setitem__(self, k, v): DEBUG and TLOG('__setitem__: called with key %s, value %s' % (k,v)) if self._timeout_slices: current_ts = getCurrentTimeslice(self._period) else: current_ts = 0 item = self._move_item(k, current_ts, _marker) STRICT and _assert(self._data.has_key(current_ts)) if item is _marker: # the key di...
def __setitem__(self, k, v): DEBUG and TLOG('__setitem__: called with key %s, value %s' % (k,v)) if self._timeout_slices: current_ts = getCurrentTimeslice(self._period) else: current_ts = 0 item = self._move_item(k, current_ts, _marker) STRICT and _assert(self._data.has_key(current_ts)) if item is _marker: # the key di...
1,616
def _getCallback(self, callback): if not callback: return None if type(callback) is type(''): try: method = self.unrestrictedTraverse(callback) except (KeyError, AttributeError): path = self.getPhysicalPath() err = 'No such onAdd/onDelete method %s referenced via %s' LOG('Transience', WARNING, err % (callback, '/'.join...
def _getCallback(self, callback): if not callback: return None if type(callback) is type(''): try: method = self.unrestrictedTraverse(callback) except (KeyError, AttributeError): path = self.getPhysicalPath() err = 'No such onAdd/onDelete method %s referenced via %s' LOG.warn(err % (callback, '/'.join(path)), exc_info=...
1,617
def _notify(self, item, callback, name): if callable(callback): sm = getSecurityManager() try: user = sm.getUser() try: newSecurityManager(None, nobody) callback(item, self) except: # dont raise, just log path = self.getPhysicalPath() LOG('Transience', WARNING, '%s failed when calling %s in %s' % (name,callback, '/'.jo...
def _notify(self, item, callback, name): if callable(callback): sm = getSecurityManager() try: user = sm.getUser() try: newSecurityManager(None, nobody) callback(item, self) except: # dont raise, just log path = self.getPhysicalPath() LOG.warn('%s failed when calling %s in %s' % (name,callback, '/'.join(path)), exc_inf...
1,618
def _notify(self, item, callback, name): if callable(callback): sm = getSecurityManager() try: user = sm.getUser() try: newSecurityManager(None, nobody) callback(item, self) except: # dont raise, just log path = self.getPhysicalPath() LOG('Transience', WARNING, '%s failed when calling %s in %s' % (name,callback, '/'.jo...
def _notify(self, item, callback, name): if callable(callback): sm = getSecurityManager() try: user = sm.getUser() try: newSecurityManager(None, nobody) callback(item, self) except: # dont raise, just log path = self.getPhysicalPath() LOG('Transience', WARNING, '%s failed when calling %s in %s' % (name,callback, '/'.jo...
1,619
def roleNames(self):
def roleNames(self):
1,620
def __str__(self, html_search=regex.compile('<html>',regex.casefold).search, ): if self._wrote: return '' # Streaming output was used.
def __str__(self, html_search=regex.compile('<html>',regex.casefold).search, ): if self._wrote: return '' # Streaming output was used.
1,621
def manage_delObjects(self,ids=[],submit='',clip_id='', clip_data='',REQUEST):
def manage_delObjects(self,ids=[],submit='',clip_id='', clip_data='',REQUEST):
1,622
def close(self): try: self.parser.close() finally: self.parser = None # nuke circular reference
def close(self): try: self.parser.close() finally: self.parser = self.feed = None # nuke circular reference
1,623
def reindex_all(self, obj=None): """
def reindex_all(self, obj=None): """
1,624
def __call__(self, REQUEST, RESPONSE): " " return self.document_src(REQUEST)
def __call__(self, REQUEST, RESPONSE): " " return self.document_src(REQUEST)
1,625
def pt_editAction(self, REQUEST, title, text, content_type, expand): """Change the title and document.""" if SUPPORTS_WEBDAV_LOCKS and self.wl_isLocked(): raise ResourceLockedError, "File is locked via WebDAV" self.expand=expand self.pt_setTitle(title) self.pt_edit(text, content_type) REQUEST.set('text', self.read()) #...
def pt_editAction(self, REQUEST, title, text, content_type, expand): """Change the title and document.""" if self.wl_isLocked(): raise ResourceLockedError, "File is locked via WebDAV" self.expand=expand self.pt_setTitle(title) self.pt_edit(text, content_type) REQUEST.set('text', self.read()) # May not equal 'text'! REQ...
1,626
def pt_upload(self, REQUEST, file='', charset=None): """Replace the document with the text in file.""" if SUPPORTS_WEBDAV_LOCKS and self.wl_isLocked(): raise ResourceLockedError, "File is locked via WebDAV"
def pt_upload(self, REQUEST, file='', charset=None): """Replace the document with the text in file.""" if self.wl_isLocked(): raise ResourceLockedError, "File is locked via WebDAV"
1,627
def PUT(self, REQUEST, RESPONSE): """ Handle HTTP PUT requests """ self.dav__init(REQUEST, RESPONSE) if SUPPORTS_WEBDAV_LOCKS: self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1) self.write(REQUEST.get('BODY', '')) RESPONSE.setStatus(204) return RESPONSE
def PUT(self, REQUEST, RESPONSE): """ Handle HTTP PUT requests """ self.dav__init(REQUEST, RESPONSE) self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1) self.write(REQUEST.get('BODY', '')) RESPONSE.setStatus(204) return RESPONSE
1,628
def pt_source_file(self): """Returns a file name to be compiled into the TAL code.""" try: return '/'.join(self.getPhysicalPath()) except: # This page template is being compiled without an # acquisition context, so we don't know where it is. :-( return None
def pt_source_file(self): """Returns a file name to be compiled into the TAL code.""" try: return '/'.join(self.getPhysicalPath()) except: # This page template is being compiled without an # acquisition context, so we don't know where it is. :-( return None
1,629
def initialize(app): # Initialize the application # Initialize the cache: app.Control_Panel.initialize_cache() # The following items marked b/c are backward compatibility hacks # which make sure that expected system objects are added to the # bobobase. This is required because the bobobase in use may pre- # date the ...
def initialize(app): # Initialize the application # Initialize the cache: app.Control_Panel.initialize_cache() # The following items marked b/c are backward compatibility hacks # which make sure that expected system objects are added to the # bobobase. This is required because the bobobase in use may pre- # date the ...
1,630
def import_products(): # Try to import each product, checking for and catching errors. done={} for product_dir in Products.__path__: product_names=os.listdir(product_dir) product_names.sort() # Hack !!! # We must initialize the PluginIndexes first before # all other products (ajung) product_names.remove("PluginInde...
def import_products(): # Try to import each product, checking for and catching errors. done={} for product_dir in Products.__path__: product_names=os.listdir(product_dir) product_names.sort() # Hack !!! # We must initialize the PluginIndexes first before # all other products (ajung) if "PluginIndexes" in product_na...
1,631
def install_products(app): # Install a list of products into the basic folder class, so # that all folders know about top-level objects, aka products folder_permissions = get_folder_permissions() meta_types=[] done={} get_transaction().note('Prior to product installs') get_transaction().commit() for product_dir in P...
def install_products(app): # Install a list of products into the basic folder class, so # that all folders know about top-level objects, aka products folder_permissions = get_folder_permissions() meta_types=[] done={} get_transaction().note('Prior to product installs') get_transaction().commit() for product_dir in P...
1,632
def main(): # below assumes this script is in the BASE_DIR/inst directory global PREFIX BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0]))) BUILD_BASE=os.path.join(os.getcwd(), 'build-base') PYTHON=sys.executable MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read() REQUIRE_LF_ENABLED = ...
def main(): # below assumes this script is in the BASE_DIR/inst directory global PREFIX BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0]))) BUILD_BASE=os.path.join(os.getcwd(), 'build-base', 'python-%s.%s' % sys.version_info[:2]) PYTHON=sys.executable MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_...
1,633
def __getitem__(self, key): for d in self.dicts: try: return d[key] except KeyError, AttributeError: pass raise KeyError, key
def __getitem__(self, key): for d in self.dicts: try: return d[key] except (KeyError, AttributeError): pass raise KeyError, key
1,634
def unrestrictedTraverse(self, path, default=_marker, restricted=False): """Lookup an object by path.
def unrestrictedTraverse(self, path, default=_marker, restricted=False): """Lookup an object by path.
1,635
def render(self, md): # first we try to render the first block try: return render_blocks(self.section, md) except: # but an error occurs.. save the info. einfo = sys.exc_info() if type(einfo[0])==type(''): errname = einfo[0] else: errname = einfo[0].__name__
def render(self, md): # first we try to render the first block try: return render_blocks(self.section, md) except: # but an error occurs.. save the info. t,v = sys.exc_info()[:2] if type(t)==type(''): errname = t else: errname = einfo[0].__name__
1,636
def render(self, md): # first we try to render the first block try: return render_blocks(self.section, md) except: # but an error occurs.. save the info. einfo = sys.exc_info() if type(einfo[0])==type(''): errname = einfo[0] else: errname = einfo[0].__name__
def render(self, md): # first we try to render the first block try: return render_blocks(self.section, md) except: # but an error occurs.. save the info. einfo = sys.exc_info() if type(einfo[0])==type(''): errname = einfo[0] else: errname = einfo[0].__name__
1,637
def render(self, md): # first we try to render the first block try: return render_blocks(self.section, md) except: # but an error occurs.. save the info. einfo = sys.exc_info() if type(einfo[0])==type(''): errname = einfo[0] else: errname = einfo[0].__name__
def render(self, md): # first we try to render the first block try: return render_blocks(self.section, md) except: # but an error occurs.. save the info. einfo = sys.exc_info() if type(einfo[0])==type(''): errname = einfo[0] else: errname = einfo[0].__name__
1,638
def render(self, md): # first we try to render the first block try: return render_blocks(self.section, md) except: # but an error occurs.. save the info. einfo = sys.exc_info() if type(einfo[0])==type(''): errname = einfo[0] else: errname = einfo[0].__name__
def render(self, md): # first we try to render the first block try: return render_blocks(self.section, md) except: # but an error occurs.. save the info. einfo = sys.exc_info() if type(einfo[0])==type(''): errname = einfo[0] else: errname = einfo[0].__name__
1,639
def testNoImplicitAccess(self): class person: name='Jim'
def testNoImplicitAccess(self): class person: name='Jim'
1,640
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stup...
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stupid_log if...
1,641
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stup...
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: _stupid_dest=sys.stderr elif os.environ.get('Z_DEBUG_MODE',0):...
1,642
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stup...
def stupid_log_write(subsystem, severity, summary, detail, error): if severity < 0: return global _stupid_dest if _stupid_dest is None: import os if os.environ.has_key('STUPID_LOG_FILE'): f=os.environ['STUPID_LOG_FILE'] if f: _stupid_dest=open(f,'a') else: import sys _stupid_dest=sys.stderr else: _stupid_dest=_no_stup...
1,643
def _checkId(self, id, allow_dup=1, _reserved=('propertysheets',)): if id in _reserved: raise 'Bad Request', 'The id, %s, is reseverd' % id ZClassMethodsSheet.inheritedAttribute('_checkId')( self, id, allow_dup) return id+' '
def _checkId(self, id, allow_dup=0, _reserved=('propertysheets','manage_workspace')): if id in _reserved: raise 'Bad Request', 'The id, %s, is reseverd' % id ZClassMethodsSheet.inheritedAttribute('_checkId')( self, id, allow_dup) return id+' '
1,644
def _checkId(self, id, allow_dup=1, _reserved=('propertysheets',)): if id in _reserved: raise 'Bad Request', 'The id, %s, is reseverd' % id ZClassMethodsSheet.inheritedAttribute('_checkId')( self, id, allow_dup) return id+' '
def _checkId(self, id, allow_dup=1, _reserved=('propertysheets',)): if id in _reserved: raise 'Bad Request', 'The id, %s, is reseverd' % id ZClassMethodsSheet.inheritedAttribute('_checkId')( self, id, 0) return id+' '
1,645
def __init__(self, id, title, file, content_type='', precondition=''): self.__name__=id self.title=title self.precondition=precondition headers=hasattr(file, 'headers') and file.headers or None data=(headers is None) and file or file.read() if headers and headers.has_key('content-type') and (not content_type): content_...
def __init__(self, id, title, file, content_type='', precondition=''): self.__name__=id self.title=title self.precondition=precondition headers=hasattr(file, 'headers') and file.headers or None if hasattr(file, 'read'): data=file.read() else: data=file if headers and headers.has_key('content-type') and (not content_typ...
1,646
def positions(self, docid, words): """Return the positions in the document for the given document id of the word, word.""" id = self.id
def positions(self, docid, words, obj): """Return the positions in the document for the given document id of the word, word.""" id = self.id
1,647
def positions(self, docid, words): """Return the positions in the document for the given document id of the word, word.""" id = self.id
def positions(self, docid, words): """Return the positions in the document for the given document id of the word, word.""" id = self.id
1,648
def positions(self, docid, words): """Return the positions in the document for the given document id of the word, word.""" id = self.id
def positions(self, docid, words): """Return the positions in the document for the given document id of the word, word.""" id = self.id
1,649
def positions(self, docid, words): """Return the positions in the document for the given document id of the word, word.""" id = self.id
def positions(self, docid, words): """Return the positions in the document for the given document id of the word, word.""" id = self.id
1,650
def initialize_cache(self): try: db=self._p_jar.db() except: # BoboPOS2 Globals.Bobobase._jar.cache.cache_size=self._cache_size Globals.Bobobase._jar.cache.cache_age =self._cache_age else: db.SetCacheSize(self._cache_size) db.SetCacheDeactivateAfter(self._cache_age) db.SetVersionCacheSize(self._vcache_size) db.SetVersi...
def initialize_cache(self): try: db=self._p_jar.db() except: # BoboPOS2 Globals.Bobobase._jar.cache.cache_size=self._cache_size Globals.Bobobase._jar.cache.cache_age =self._cache_age else: db.SetCacheSize(self._cache_size) db.SetCacheDeactivateAfter(self._cache_age) db.SetVersionCacheSize(self._vcache_size) db.SetVersi...
1,651
def onDeleteObject(self): """Object delete handler.""" self.unindex_object()
def onDeleteObject(self): """Object delete handler. I think this is obsoleted by manage_beforeDelete """ self.unindex_object()
1,652
def __init__(self, id, title, bases, zope_object=1): """Build a Zope class
def __init__(self, id, title, bases, zope_object=1): """Build a Zope class
1,653
def pt_macro(self): self._cook_check() return PageTemplate.pt_macro(self)
def pt_macros(self): self._cook_check() return PageTemplate.pt_macro(self)
1,654
def pt_macro(self): self._cook_check() return PageTemplate.pt_macro(self)
def pt_macro(self): self._cook_check() return PageTemplate.pt_macro(self)
1,655
def sort_sequence(self, sequence):
def sort_sequence(self, sequence):
1,656
def sort_sequence(self, sequence):
def sort_sequence(self, sequence):
1,657
def sort_sequence(self, sequence):
def sort_sequence(self, sequence):
1,658
def sort_sequence(self, sequence):
defsort_sequence(self,sequence):
1,659
def reverse_sequence(self, sequence): s=list(sequence) s.reverse() return s
def reverse_sequence(self, sequence): s=list(sequence) s.reverse() return s
1,660
def __getitem__(self,index):
def __getitem__(self,index):
1,661
def __getitem__(self,index):
def __getitem__(self,index):
1,662
def __getitem__(self,index):
def __getitem__(self,index):
1,663
def ch(path, user, group, mode=0600): if group: mode=mode+060 do("chgrp %s %s" % (group, path), 0) if user: do("chown %s %s" % (group, path), 0) do("chmod %s %s" % (oct(mode), path), 0)
def ch(path, user, group, mode=0600): if group: mode=mode+060 do("chgrp %s %s" % (group, path), 0) if user: do("chown %s %s" % (user, path), 0) do("chmod %s %s" % (oct(mode), path), 0)
1,664
def open_bobobase(): # Open the application database Bobobase=Globals.Bobobase=Globals.PickleDictionary(Globals.BobobaseName) product_dir=os.path.join(SOFTWARE_HOME,'lib/python/Products') __traceback_info__=sys.path try: app=Bobobase['Application'] except KeyError: app=Application() app._init() Bobobase['Applicatio...
def open_bobobase(): # Open the application database Bobobase=Globals.Bobobase=Globals.PickleDictionary(Globals.BobobaseName) product_dir=os.path.join(SOFTWARE_HOME,'lib/python/Products') __traceback_info__=sys.path try: app=Bobobase['Application'] except KeyError: app=Application() app._init() Bobobase['Applicatio...
1,665
def guarded_getitem(object, index): v = object[index] if getSecurityManager().validate(object, object, index, v): return v raise Unauthorized, 'unauthorized access to element %s' % `i`
def guarded_getitem(object, index): v = object[index] if getSecurityManager().validate(object, object, index, v): return v raise Unauthorized, 'unauthorized access to element %s' % `i`
1,666
def complex_marshal(pairs): '''Add request marshalling information to a list of name-value pairs. Names must be strings. Values may be strings, integers, floats, or DateTimes, and they may also be lists or namespaces containing these types. The list is edited in place so that each (name, value) pair becomes a (name,...
def complex_marshal(pairs): '''Add request marshalling information to a list of name-value pairs. Names must be strings. Values may be strings, integers, floats, or DateTimes, and they may also be lists or namespaces containing these types. The list is edited in place so that each (name, value) pair becomes a (name,...
1,667
def complex_marshal(pairs): '''Add request marshalling information to a list of name-value pairs. Names must be strings. Values may be strings, integers, floats, or DateTimes, and they may also be lists or namespaces containing these types. The list is edited in place so that each (name, value) pair becomes a (name,...
def complex_marshal(pairs): '''Add request marshalling information to a list of name-value pairs. Names must be strings. Values may be strings, integers, floats, or DateTimes, and they may also be lists or namespaces containing these types. The list is edited in place so that each (name, value) pair becomes a (name,...
1,668
def simple_marshal(v): if isinstance(v, StringType): return '' if isinstance(v, BooleanType): return ':boolean' if isinstance(v, IntType): return ':int' if isinstance(v, FloatType): return ':float' if isinstance(v, DateTime): return ':date' return ''
def simple_marshal(v): if isinstance(v, str): return '' if isinstance(v, BooleanType): return ':boolean' if isinstance(v, IntType): return ':int' if isinstance(v, FloatType): return ':float' if isinstance(v, DateTime): return ':date' return ''
1,669
def simple_marshal(v): if isinstance(v, StringType): return '' if isinstance(v, BooleanType): return ':boolean' if isinstance(v, IntType): return ':int' if isinstance(v, FloatType): return ':float' if isinstance(v, DateTime): return ':date' return ''
def simple_marshal(v): if isinstance(v, StringType): return '' if isinstance(v, bool): return ':boolean' if isinstance(v, IntType): return ':int' if isinstance(v, FloatType): return ':float' if isinstance(v, DateTime): return ':date' return ''
1,670
def simple_marshal(v): if isinstance(v, StringType): return '' if isinstance(v, BooleanType): return ':boolean' if isinstance(v, IntType): return ':int' if isinstance(v, FloatType): return ':float' if isinstance(v, DateTime): return ':date' return ''
def simple_marshal(v): if isinstance(v, StringType): return '' if isinstance(v, BooleanType): return ':boolean' if isinstance(v, int): return ':int' if isinstance(v, FloatType): return ':float' if isinstance(v, DateTime): return ':date' return ''
1,671
def simple_marshal(v): if isinstance(v, StringType): return '' if isinstance(v, BooleanType): return ':boolean' if isinstance(v, IntType): return ':int' if isinstance(v, FloatType): return ':float' if isinstance(v, DateTime): return ':date' return ''
def simple_marshal(v): if isinstance(v, StringType): return '' if isinstance(v, BooleanType): return ':boolean' if isinstance(v, IntType): return ':int' if isinstance(v, float): return ':float' if isinstance(v, DateTime): return ':date' return ''
1,672
def get_module_info(module_name, modules={}, acquire=_l.acquire, release=_l.release, ): if modules.has_key(module_name): return modules[module_name] if module_name[-4:]=='.cgi': module_name=module_name[:-4] acquire() tb=None try: try: module=__import__(module_name, globals(), globals(), ('__doc__',)) realm=module_n...
def get_module_info(module_name, modules={}, acquire=_l.acquire, release=_l.release, ): if modules.has_key(module_name): return modules[module_name] if module_name[-4:]=='.cgi': module_name=module_name[:-4] acquire() tb=None try: try: module=__import__(module_name, globals(), globals(), ('__doc__',)) realm=module_n...
1,673
def testResolveUrl(self): # Check that ResolveUrl really raises the same error
def testResolveUrl(self): # Check that ResolveUrl really raises the same error
1,674
def testResolveUrl(self): # Check that ResolveUrl really raises the same error
def testResolveUrl(self): # Check that ResolveUrl really raises the same error
1,675
def test_export_import_as_file_idempotent(self): from OFS.DTMLMethod import DTMLMethod from OFS.XMLExportImport import exportXML from OFS.XMLExportImport import importXML
def test_export_import_as_file_idempotent(self): from OFS.DTMLMethod import DTMLMethod from OFS.XMLExportImport import exportXML from OFS.XMLExportImport import importXML
1,676
def test_export_import_as_file_idempotent(self): from OFS.DTMLMethod import DTMLMethod from OFS.XMLExportImport import exportXML from OFS.XMLExportImport import importXML
def test_export_import_as_file_idempotent(self): from OFS.DTMLMethod import DTMLMethod from OFS.XMLExportImport import exportXML from OFS.XMLExportImport import importXML
1,677
def test_export_import_as_file_idempotent(self): from OFS.DTMLMethod import DTMLMethod from OFS.XMLExportImport import exportXML from OFS.XMLExportImport import importXML
def test_export_import_as_file_idempotent(self): from OFS.DTMLMethod import DTMLMethod from OFS.XMLExportImport import exportXML from OFS.XMLExportImport import importXML
1,678
def test_export_import_as_file_idempotent(self): from OFS.DTMLMethod import DTMLMethod from OFS.XMLExportImport import exportXML from OFS.XMLExportImport import importXML
def test_export_import_as_file_idempotent(self): from OFS.DTMLMethod import DTMLMethod from OFS.XMLExportImport import exportXML from OFS.XMLExportImport import importXML
1,679
def test_OFS_ObjectManager__importObjectFromFile_xml(self): from OFS.DTMLMethod import DTMLMethod from OFS.Folder import Folder from OFS.XMLExportImport import exportXML
def test_OFS_ObjectManager__importObjectFromFile_xml(self): from OFS.DTMLMethod import DTMLMethod from OFS.Folder import Folder from OFS.XMLExportImport import exportXML
1,680
def test_OFS_ObjectManager__importObjectFromFile_xml(self): from OFS.DTMLMethod import DTMLMethod from OFS.Folder import Folder from OFS.XMLExportImport import exportXML
def test_OFS_ObjectManager__importObjectFromFile_xml(self): from OFS.DTMLMethod import DTMLMethod from OFS.Folder import Folder from OFS.XMLExportImport import exportXML
1,681
def test_OFS_ObjectManager__importObjectFromFile_xml(self): from OFS.DTMLMethod import DTMLMethod from OFS.Folder import Folder from OFS.XMLExportImport import exportXML
def test_OFS_ObjectManager__importObjectFromFile_xml(self): from OFS.DTMLMethod import DTMLMethod from OFS.Folder import Folder from OFS.XMLExportImport import exportXML
1,682
def __init__( self, id, ignore_ex=None, call_methods=None, extra=None, caller=None): """Create an unindex
def __init__( self, id, ignore_ex=None, call_methods=None, extra=None, caller=None): """Create an unindex
1,683
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
1,684
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
1,685
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
1,686
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
1,687
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
1,688
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
1,689
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUr...
1,690
def manage_addZCatalog(self, id, title, vocab_id=None, # Deprecated REQUEST=None): """Add a ZCatalog object """ id=str(id) title=str(title) c=ZCatalog(id, title, vocab_id, self) self._setObject(id, c) if REQUEST is not None: return self.manage_main(self, REQUEST,update_menu=1)
def manage_addZCatalog(self, id, title, vocab_id=None, # Deprecated REQUEST=None): """Add a ZCatalog object """ id=str(id) title=str(title) c=ZCatalog(id, title, vocab_id, self) self._setObject(id, c) if REQUEST is not None: return self.manage_main(self, REQUEST,update_menu=1)
1,691
def manage_addZCatalog(self, id, title, vocab_id=None, # Deprecated REQUEST=None): """Add a ZCatalog object """ id=str(id) title=str(title) c=ZCatalog(id, title, vocab_id, self) self._setObject(id, c) if REQUEST is not None: return self.manage_main(self, REQUEST,update_menu=1)
defmanage_addZCatalog(self,id,title,vocab_id=None,#DeprecatedREQUEST=None):"""AddaZCatalogobject"""id=str(id)title=str(title)c=ZCatalog(id,title,vocab_id,self)self._setObject(id,c)ifREQUESTisnotNone:returnself.manage_main(self,REQUEST,update_menu=1)
1,692
def zpublisher_exception_hook( published, REQUEST, t, v, traceback, # static StringType=type(''), lower=string.lower, ConflictError=ZODB.POSException.ConflictError, ListType=type([]), ): try: if ((type(t) is StringType and lower(t) in ('unauthorized', 'redirect')) or t is SystemExit): raise if issubclass(t, ConflictErr...
def zpublisher_exception_hook( published, REQUEST, t, v, traceback, # static StringType=type(''), ConflictError=ZODB.POSException.ConflictError, ListType=type([]), ): try: if ((type(t) is StringType and lower(t) in ('unauthorized', 'redirect')) or t is SystemExit): raise if issubclass(t, ConflictError): # now what # Fi...
1,693
def zpublisher_exception_hook( published, REQUEST, t, v, traceback, # static StringType=type(''), lower=string.lower, ConflictError=ZODB.POSException.ConflictError, ListType=type([]), ): try: if ((type(t) is StringType and lower(t) in ('unauthorized', 'redirect')) or t is SystemExit): raise if issubclass(t, ConflictErr...
def zpublisher_exception_hook( published, REQUEST, t, v, traceback, # static StringType=type(''), lower=string.lower, ConflictError=ZODB.POSException.ConflictError, ListType=type([]), ): try: if ((type(t) is StringType and lower(t) in ('unauthorized', 'redirect')) or t is SystemExit): raise if issubclass(t, ConflictErr...
1,694
def open_bobobase(): # Open the application database Bobobase=Globals.Bobobase=Globals.PickleDictionary(Globals.BobobaseName) product_dir=os.path.join(SOFTWARE_HOME,'Products') sys.path.append(product_dir) try: app=Bobobase['Application'] except KeyError: app=Application() app._init() Bobobase['Application']=app get_...
def open_bobobase(): # Open the application database Bobobase=Globals.Bobobase=Globals.PickleDictionary(Globals.BobobaseName) product_dir=os.path.join(SOFTWARE_HOME,'Products') sys.path.append(product_dir) try: app=Bobobase['Application'] except KeyError: app=Application() app._init() Bobobase['Application']=app get_...
1,695
def install_products(): # Install a list of products into the basic folder class, so # that all folders know about top-level objects, aka products path_join=os.path.join product_dir=path_join(SOFTWARE_HOME,'Products') isdir=os.path.isdir exists=os.path.exists app =Globals.Bobobase['Application'] meta_types=list...
def install_products(): # Install a list of products into the basic folder class, so # that all folders know about top-level objects, aka products path_join=os.path.join product_dir=path_join(SOFTWARE_HOME,'Products') isdir=os.path.isdir exists=os.path.exists app =Globals.Bobobase['Application'] meta_types=list...
1,696
def custom_default_report(id, result, action='', no_table=0): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\t</tr>' % string.joinfields( map(lambda c: '\t<th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ', ' e...
def custom_default_report(id, result, action='', no_table=0): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\t</tr>' % string.joinfields( map(lambda c: '\t<th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ', ' e...
1,697
def custom_default_report(id, result, action='', no_table=0): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\t</tr>' % string.joinfields( map(lambda c: '\t<th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ', ' e...
def custom_default_report(id, result, action='', no_table=0): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\t</tr>' % string.joinfields( map(lambda c: '\t<th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ', ' e...
1,698
def _indexedSearch(self, args, sort_index, append, used):
def _indexedSearch(self, args, sort_index, append, used):
1,699