bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def manage_FTPget(self): "Get source for FTP download" return self.read()
def manage_FTPget(self): "Get source for FTP download" return self.read()
2,900
def manage_addUserFolder(self,dtself=None,REQUEST=None,**ignored): """ """ f=UserFolder() self=self.this() try: self._setObject('acl_users', f) except: return MessageDialog( title ='Item Exists', message='This object already contains a User Folder', action ='%s/manage_main' % REQUEST['URL1']) self.__allow_groups__=...
def manage_addUserFolder(self,dtself=None,REQUEST=None,**ignored): """ """ f=UserFolder() self=self.this() try: self._setObject('acl_users', f) except: return MessageDialog( title ='Item Exists', message='This object already contains a User Folder', action ='%s/manage_main' % REQUEST['URL1']) self.__allow_groups__=...
2,901
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
2,902
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
2,903
def doc_literal( self, s, expr=re.compile( "(?:\s|^)'" # open "([^ \t\n\r\f\v']|[^ \t\n\r\f\v'][^\n']*[^ \t\n\r\f\v'])" # contents "'(?:\s|[,.;:!?]|$)" # close ).search): r=expr(s) if r: start, end = r.span(1) return (StructuredTex...
def doc_literal( self, s, expr=re.compile( "(?:\s|^)'" # open "([^ \t\n\r\f\v']|[^ \t\n\r\f\v'][^\n']*[^ \t\n\r\f\v'])" # contents "'(?:\s|[,.;:!?]|$)" # close ).search): r=expr(s) if r: start, end = r.span(1) return (StructuredTex...
2,904
def doc_literal( self, s, expr=re.compile( "(?:\s|^)'" # open "([^ \t\n\r\f\v']|[^ \t\n\r\f\v'][^\n']*[^ \t\n\r\f\v'])" # contents "'(?:\s|[,.;:!?]|$)" # close ).search): r=expr(s) if r: start, end = r.span(1) return (StructuredTex...
def doc_literal( self, s, expr=re.compile( "(?:\s|^)'" # open "([^ \t\n\r\f\v']|[^ \t\n\r\f\v'][^\n']*[^ \t\n\r\f\v'])" # contents "'(?:\s|[,.;:!?]|$)" # close ).search): r=expr(s) if r: start, end = r.span(1) return (StructuredTex...
2,905
def doc_emphasize( self, s, expr = re.compile('\s*\*([ \na-zA-Z0-9.:/;,\'\"\?]+)\*(?!\*|-)').search ):
def doc_emphasize( self, s, expr = re.compile('\s*\*([ \na-zA-Z0-9.:/;,\'\"\?\=\-\>\<\(\)]+)\*(?!\*|-)').search ):
2,906
def __cmp__(self,other): return cmp((self.co_argcount, self.co_varnames), (other.co_argcount, other.co_varnames))
def __cmp__(self,other): return cmp((self.co_argcount, self.co_varnames), (other.co_argcount, other.co_varnames))
2,907
def __init__(self,
def __init__(self,
2,908
def ZopeFindAndApply(self, obj, obj_ids=None, obj_metatypes=None, obj_searchterm=None, obj_expr=None, obj_mtime=None, obj_mspec=None, obj_permission=None, obj_roles=None, search_sub=0, REQUEST=None, result=None, pre='', apply_func=None, apply_path=''): """Zope Find interface and apply
def ZopeFindAndApply(self, obj, obj_ids=None, obj_metatypes=None, obj_searchterm=None, obj_expr=None, obj_mtime=None, obj_mspec=None, obj_permission=None, obj_roles=None, search_sub=0, REQUEST=None, result=None, pre='', apply_func=None, apply_path=''): """Zope Find interface and apply
2,909
def query_data(self,REQUEST):
def query_data(self,REQUEST):
2,910
def manage_test(self,REQUEST):
def manage_test(self,REQUEST):
2,911
def set(self, word): """ return the word id of 'word' """
def set(self, word): """ return the word id of 'word' """
2,912
def testRunIgnoresParentSignals(self): # Spawn a process which will in turn spawn a zdrun process. # We make sure that the zdrun process is still running even if # its parent process receives an interrupt signal (it should # not be passed to zdrun). zdrun_socket = os.path.join(self.here, 'testsock') zdctlpid = os.spawn...
def testRunIgnoresParentSignals(self): # Spawn a process which will in turn spawn a zdrun process. # We make sure that the zdrun process is still running even if # its parent process receives an interrupt signal (it should # not be passed to zdrun). zdrun_socket = os.path.join(self.here, 'testsock') zdctlpid = os.spawn...
2,913
def testRunIgnoresParentSignals(self): # Spawn a process which will in turn spawn a zdrun process. # We make sure that the zdrun process is still running even if # its parent process receives an interrupt signal (it should # not be passed to zdrun). zdrun_socket = os.path.join(self.here, 'testsock') zdctlpid = os.spawn...
def testRunIgnoresParentSignals(self): # Spawn a process which will in turn spawn a zdrun process. # We make sure that the zdrun process is still running even if # its parent process receives an interrupt signal (it should # not be passed to zdrun). zdrun_socket = os.path.join(self.here, 'testsock') zdctlpid = os.spawn...
2,914
def manage_cache_size(self,value,REQUEST): "set cache size" db = self._getDB() if self._inVersion(): db.setVersionCacheSize(value) else: db.setCacheSize(value)
def manage_cache_size(self,value,REQUEST): "set cache size" db = self._getDB() if self._inVersion(): db.setVersionCacheSize(value) else: db.setCacheSize(value)
2,915
def setRoles(self, roles):
def setRoles(self, roles):
2,916
def delRoles(self, roles):
def delRoles(self, roles):
2,917
def __setstate__(self, state): Globals.Persistent.__setstate__(self, state) if self.connection_string: try: self.connect(self.connection_string) except: LOG.error('Error connecting to relational database.', exc_info=exc_info())
def __setstate__(self, state): Globals.Persistent.__setstate__(self, state) if self.connection_string: try: self.connect(self.connection_string) except: LOG.error('Error connecting to relational database.', exc_info=exc_info())
2,918
def manage_close_connection(self, REQUEST=None): " " try: if hasattr(self,'_v_database_connection'): self._v_database_connection.close() except: LOG.error('Error closing relational database connection.', exc_info=exc_info()) self._v_connected='' if REQUEST is not None: return self.manage_main(self, REQUEST)
def manage_close_connection(self, REQUEST=None): " " try: if hasattr(self,'_v_database_connection'): self._v_database_connection.close() except: LOG.error('Error closing relational database connection.', exc_info=True) self._v_connected='' if REQUEST is not None: return self.manage_main(self, REQUEST)
2,919
def __init__(self, id, baseid, PATH_INFO): self.id=id self._refid=baseid version=PATH_INFO l=version.rfind(/') if l >= 0: version=version[:l] self._version="%s/%s" % (version, id) self.users__draft__=uf=AccessControl.User.UserFolder() self.__allow_groups__=uf
def __init__(self, id, baseid, PATH_INFO): self.id=id self._refid=baseid version=PATH_INFO l=version.rfind('/') if l >= 0: version=version[:l] self._version="%s/%s" % (version, id) self.users__draft__=uf=AccessControl.User.UserFolder() self.__allow_groups__=uf
2,920
def get(self, key, default=None, returnTaints=0, URLmatch=re.compile('URL(PATH)?([0-9]+)$').match, BASEmatch=re.compile('BASE(PATH)?([0-9]+)$').match, ): """Get a variable value
def get(self, key, default=None, returnTaints=0, URLmatch=re.compile('URL(PATH)?([0-9]+)$').match, BASEmatch=re.compile('BASE(PATH)?([0-9]+)$').match, ): """Get a variable value
2,921
def get(self, key, default=None, returnTaints=0, URLmatch=re.compile('URL(PATH)?([0-9]+)$').match, BASEmatch=re.compile('BASE(PATH)?([0-9]+)$').match, ): """Get a variable value
def get(self, key, default=None, returnTaints=0, URLmatch=re.compile('URL(PATH)?([0-9]+)$').match, BASEmatch=re.compile('BASE(PATH)?([0-9]+)$').match, ): """Get a variable value
2,922
def __getattr__(self, name): if name[:3]=='_p_': return BrokenClass.inheritedAttribute('__getattr__')(self, name) raise AttributeError, escape(name)
def __getattr__(self, name): if name[:3]=='_p_': return BrokenClass.inheritedAttribute('__getattr__')(self, name) raise AttributeError, escape(name)
2,923
def registerClass(self, instance_class=None, meta_type='', permission=None, constructors=(), icon=None, permissions=None, legacy=(), ): """Register a constructor
def registerClass(self, instance_class=None, meta_type='', permission=None, constructors=(), icon=None, permissions=None, legacy=(), ): """Register a constructor
2,924
def manage_historyCopy(self, keys=[], RESPONSE=None, URL1=None): "Copy a selected revision to the present" if not keys: raise HistorySelectionError, ( "No historical revision was selected.<p>")
def manage_historyCopy(self, keys=[], RESPONSE=None, URL1=None): "Copy a selected revision to the present" if not keys: raise HistorySelectionError, ( "No historical revision was selected.<p>")
2,925
def _setObject(self,id,object,roles=None,user=None, set_owner=1): v=self._checkId(id) if v is not None: id=v try: t=object.meta_type except: t=None
def _setObject(self,id,object,roles=None,user=None, set_owner=1): v=self._checkId(id) if v is not None: id=v try: t=object.meta_type except: t=None
2,926
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,927
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,928
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,929
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,930
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,931
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,932
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,933
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,934
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,935
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,936
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,937
def __init__(self,*args): """Return a new date-time object
def __init__(self,*args): """Return a new date-time object
2,938
def pCommonZ(self):
def pCommonZ(self):
2,939
def __add__(self,other):
def __add__(self,other):
2,940
def __add__(self,other):
def __add__(self,other):
2,941
def __add__(self,other):
def __add__(self,other):
2,942
def leave(self, REQUEST, RESPONSE): """Temporarily stop working in a version""" RESPONSE.setCookie( Globals.VersionNameName,'No longer active', expires="Mon, 25-Jan-1999 23:59:59 GMT", path=REQUEST['SCRIPT_NAME'], ) if (REQUEST.has_key('SERVER_SOFTWARE') and REQUEST['SERVER_SOFTWARE'][:9]=='Microsoft'): # IIS doesn't h...
def leave(self, REQUEST, RESPONSE): """Temporarily stop working in a version""" RESPONSE.setCookie( Globals.VersionNameName,'No longer active', expires="Mon, 25-Jan-1999 23:59:59 GMT", path=(REQUEST['BASEPATH1'] or '/'), ) if (REQUEST.has_key('SERVER_SOFTWARE') and REQUEST['SERVER_SOFTWARE'][:9]=='Microsoft'): # IIS do...
2,943
def evaluate(self, expression, isinstance=isinstance, StringType=StringType): if isinstance(expression, StringType): expression = self._engine.compile(expression) __traceback_supplement__ = ( TALESTracebackSupplement, self, expression) return expression(self)
def evaluate(self, expression, isinstance=isinstance, StringType=StringType): if isinstance(expression, StringType): expression = self._engine.compile(expression) __traceback_supplement__ = ( TALESTracebackSupplement, self, expression) return expression(self)
2,944
def main(): try: opts, args = getopt.getopt(sys.argv[1:], "hu:d:s:", ["help", "user=", "dir=", "skelsrc="] ) except getopt.GetoptError, msg: usage(sys.stderr, msg) sys.exit(2) script = os.path.abspath(sys.argv[0]) user = None password = None skeltarget = None skelsrc = None for opt, arg in opts: if opt in ("-d", "--d...
def main(): try: opts, args = getopt.getopt(sys.argv[1:], "hu:d:s:", ["help", "user=", "dir=", "skelsrc="] ) except getopt.GetoptError, msg: usage(sys.stderr, msg) sys.exit(2) script = os.path.abspath(sys.argv[0]) user = None password = None skeltarget = None skelsrc = None for opt, arg in opts: if opt in ("-d", "--d...
2,945
def __init__(self, blocks): tname, args, section = blocks[0] args=parse_params(args, name='', start='1',end='-1',size='10', orphan='3',overlap='1',mapping=1, skip_unauthorized=1, previous=1, next=1, expr='', sort='', reverse=0) self.args=args has_key=args.has_key
def __init__(self, blocks): tname, args, section = blocks[0] args=parse_params(args, name='', start='1',end='-1',size='10', orphan='3',overlap='1',mapping=1, skip_unauthorized=1, previous=1, next=1, expr='', sort='', reverse=1) self.args=args has_key=args.has_key
2,946
def __init__(self, blocks): tname, args, section = blocks[0] args=parse_params(args, name='', start='1',end='-1',size='10', orphan='3',overlap='1',mapping=1, skip_unauthorized=1, previous=1, next=1, expr='', sort='', reverse=0) self.args=args has_key=args.has_key
def __init__(self, blocks): tname, args, section = blocks[0] args=parse_params(args, name='', start='1',end='-1',size='10', orphan='3',overlap='1',mapping=1, skip_unauthorized=1, previous=1, next=1, expr='', sort='', reverse=0) self.args=args has_key=args.has_key
2,947
def renderwb(self, md): expr=self.expr name=self.__name__ if expr is None: sequence=md[name] cache={ name: sequence } else: sequence=expr(md) cache=None
def renderwb(self, md): expr=self.expr name=self.__name__ if expr is None: sequence=md[name] cache={ name: sequence } else: sequence=expr(md) cache=None
2,948
def renderwob(self, md): expr=self.expr name=self.__name__ if expr is None: sequence=md[name] cache={ name: sequence } else: sequence=expr(md) cache=None
def renderwob(self, md): expr=self.expr name=self.__name__ if expr is None: sequence=md[name] cache={ name: sequence } else: sequence=expr(md) cache=None
2,949
def renderwob(self, md): expr=self.expr name=self.__name__ if expr is None: sequence=md[name] cache={ name: sequence } else: sequence=expr(md) cache=None
def renderwob(self, md): expr=self.expr name=self.__name__ if expr is None: sequence=md[name] cache={ name: sequence } else: sequence=expr(md) cache=None
2,950
def sort_sequence(self, sequence):
def sort_sequence(self, sequence):
2,951
def _get__roles__(self): imp = getattr(self.aq_parent, '%s__roles__' % self.__name__) return imp.__of__(self)
def _get__roles__(self): imp = getattr(self.aq_parent, '%s__roles__' % self.__name__) return imp.__of__(self)
2,952
def unindex_object(self,documentId): try: self.ids.remove(Id) except: pass
def unindex_object(self,documentId): try: self.ids.remove(Id) except: pass
2,953
def _setProperty(self, id, value, type='string'): # for selection and multiple selection properties # the value argument indicates the select variable # of the property id=id.strip() self._wrapperCheck(value) if not self.valid_property_id(id): raise 'Bad Request', 'Invalid or duplicate property id'
def _setProperty(self, id, value, type='string'): # for selection and multiple selection properties # the value argument indicates the select variable # of the property self._wrapperCheck(value) if not self.valid_property_id(id): raise 'Bad Request', 'Invalid or duplicate property id'
2,954
def manage_addProperty(self, id, value, type, REQUEST=None): """Add a new property via the web. Sets a new property with the given id, type, and value.""" if type_converters.has_key(type): value=type_converters[type](value) self._setProperty(id, value, type) if REQUEST is not None: return self.manage_propertiesForm(sel...
def manage_addProperty(self, id, value, type, REQUEST=None): """Add a new property via the web. Sets a new property with the given id, type, and value.""" if type_converters.has_key(type): value=type_converters[type](value) self._setProperty(id.strip(), value, type) if REQUEST is not None: return self.manage_properties...
2,955
def __init__(self, name, seq, context): ZTUtils.Iterator.__init__(self, seq) self.name = name self._context = context
def __init__(self, name, seq, context): ZTUtils.Iterator.__init__(self, seq) self.name = name self._context = context
2,956
def next(self): if ZTUtils.Iterator.next(self): self._context.setLocal(self.name, self.item) return 1 return 0
def next(self): if ZTUtils.Iterator.next(self): context = self._context_ref() if context is not None: context.setLocal(self.name, self.item) return 1 return 0
2,957
def __init__(self, id, extra=None, caller=None, index_factory=None, field_name=None, lexicon_id=None): self.id = id
def __init__(self, id, extra=None, caller=None, index_factory=None, field_name=None, lexicon_id=None): self.id = id
2,958
def add(self, id, title, external_name, REQUEST=None): """Add an external method to a folder""" names=split(external_name,'.') module, function = join(names[:-1],'.'), names[-1] i=ExternalMethod(id,title,module,function) self._setObject(id,i) return self.manage_main(self,REQUEST)
def add(self, id, title, external_name, REQUEST=None): """Add an external method to a folder""" names=split(external_name,'.') module, function = join(names[:-1],'.'), names[-1] i=ExternalMethod(id,title,module,function) self._setObject(id,i) return self.manage_main(self,REQUEST)
2,959
def startup(): global app # Import products OFS.Application.import_products() configuration = getConfiguration() # Open the database dbtab = configuration.dbtab try: # Try to use custom storage try: m=imp.find_module('custom_zodb',[configuration.testinghome]) except: m=imp.find_module('custom_zodb',[configuration.in...
def startup(): global app # Import products OFS.Application.import_products() configuration = getConfiguration() # Open the database dbtab = configuration.dbtab try: # Try to use custom storage try: m=imp.find_module('custom_zodb',[configuration.testinghome]) except: m=imp.find_module('custom_zodb',[configuration.in...
2,960
def manage_addZCatalog(id, title, vocab_id=None): """ Add a ZCatalog object. 'vocab_id' is the name of a Vocabulary object this catalog should use. A value of None will cause the Catalog to create its own private vocabulary. """
def manage_addZCatalog(id, title, vocab_id=None): """ Add a ZCatalog object. 'vocab_id' is the name of a Vocabulary object this catalog should use. A value of None will cause the Catalog to create its own private vocabulary. """
2,961
def removeForwardIndexEntry(self, entry, documentId): """Take the entry provided and remove any reference to documentId in its entry in the index. """ indexRow = self._index.get(entry, _marker) if indexRow is not _marker: try: indexRow.remove(documentId) if not indexRow: del self._index[entry] self._length.change(-1)
def removeForwardIndexEntry(self, entry, documentId): """Take the entry provided and remove any reference to documentId in its entry in the index. """ indexRow = self._index.get(entry, _marker) if indexRow is not _marker: try: indexRow.remove(documentId) if not indexRow: try: del self._index[entry] except KeyError: p...
2,962
def insertForwardIndexEntry(self, entry, documentId): """Take the entry provided and put it in the correct place in the forward index.
def insertForwardIndexEntry(self, entry, documentId): """Take the entry provided and put it in the correct place in the forward index.
2,963
def getLexicon(self): """Get the lexicon for this index """ if hasattr(aq_base(self), 'lexicon'): # Fix up old ZCTextIndexes by removing direct lexicon ref # and changing it to an ID lexicon = getattr(aq_parent(aq_inner(self)), self.lexicon.getId()) self.lexicon_id = lexicon.getId() del self.lexicon
def getLexicon(self): """Get the lexicon for this index """ if hasattr(aq_base(self), 'lexicon'): # Fix up old ZCTextIndexes by removing direct lexicon ref # and changing it to an ID lexicon = getattr(aq_parent(aq_inner(self)), self.lexicon.getId()) self.lexicon_id = lexicon.getId() del self.lexicon
2,964
def createZopeEngine(): e = ZopeEngine() e.iteratorFactory = PathIterator for pt in ZopePathExpr._default_type_names: e.registerType(pt, ZopePathExpr) e.registerType('string', StringExpr) e.registerType('python', ZRPythonExpr.PythonExpr) e.registerType('not', NotExpr) e.registerType('defer', DeferExpr) e.registerType('...
def createZopeEngine(): e = ZopeEngine() e.iteratorFactory = PathIterator for pt in ZopePathExpr._default_type_names: e.registerType(pt, ZopePathExpr) e.registerType('string', StringExpr) e.registerType('python', ZRPythonExpr.PythonExpr) e.registerType('not', NotExpr) e.registerType('defer', DeferExpr) e.registerType('...
2,965
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() try: module=__import__(module_name) realm=module_name # Let the app specify a realm if hasattr(mod...
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() try: module=__import__(module_name) realm=module_name # Let the app specify a realm if hasattr(mod...
2,966
def setProperty(self, id, value, type='string', meta=None): # Set a new property with the given id, value and optional type. # Note that different property sets may support different typing # systems. if not self.valid_property_id(id): raise 'Bad Request', 'Invalid property id.' self=self.v_self() if meta is None: meta...
def _setProperty(self, id, value, type='string', meta=None): # Set a new property with the given id, value and optional type. # Note that different property sets may support different typing # systems. if not self.valid_property_id(id): raise 'Bad Request', 'Invalid property id.' self=self.v_self() if meta is None: met...
2,967
def updateProperty(self, id, value): # Update the value of an existing property. If value is a string, # an attempt will be made to convert the value to the type of the # existing property. if not self.hasProperty(id): raise 'Bad Request', 'The property %s does not exist.' % id if type(value)==type(''): proptype=self.p...
def _updateProperty(self, id, value): # Update the value of an existing property. If value is a string, # an attempt will be made to convert the value to the type of the # existing property. if not self.hasProperty(id): raise 'Bad Request', 'The property %s does not exist.' % id if type(value)==type(''): proptype=self....
2,968
def delProperty(self, id): # Delete the property with the given id. If a property with the # given id does not exist, a ValueError is raised. if not self.hasProperty(id): raise ValueError, 'The property %s does not exist.' % id self=self.v_self() delattr(self, id) self._properties=tuple(filter(lambda i, n=id: i['id'] !...
def _delProperty(self, id): # Delete the property with the given id. If a property with the # given id does not exist, a ValueError is raised. if not self.hasProperty(id): raise ValueError, 'The property %s does not exist.' % id self=self.v_self() delattr(self, id) self._properties=tuple(filter(lambda i, n=id: i['id'] ...
2,969
def manage_addProperty(self, id, value, type, REQUEST=None): """Add a new property via the web. Sets a new property with the given id, type, and value.""" if type_converters.has_key(type): value=type_converters[type](value) self.setProperty(id, value, type) if REQUEST is not None: return self.manage_propertiesForm(self...
def manage_addProperty(self, id, value, type, REQUEST=None): """Add a new property via the web. Sets a new property with the given id, type, and value.""" if type_converters.has_key(type): value=type_converters[type](value) self._setProperty(id, value, type) if REQUEST is not None: return self.manage_propertiesForm(sel...
2,970
def manage_changeProperties(self, REQUEST=None, **kw): """Change existing object properties by passing either a mapping object of name:value pairs {'foo':6} or passing name=value parameters.""" if REQUEST is None: props={} else: props=REQUEST if kw: for name, value in kw.items(): props[name]=value propdict=self.propdic...
def manage_changeProperties(self, REQUEST=None, **kw): """Change existing object properties by passing either a mapping object of name:value pairs {'foo':6} or passing name=value parameters.""" if REQUEST is None: props={} else: props=REQUEST if kw: for name, value in kw.items(): props[name]=value propdict=self.propdic...
2,971
def manage_delProperties(self, ids=None, REQUEST=None): """Delete one or more properties specified by 'ids'.""" if ids is None: return MessageDialog( title='No property specified', message='No properties were specified!', action ='./manage_propertiesForm',) propdict=self.propdict() vself=self.v_self() if hasattr(vself,...
def manage_delProperties(self, ids=None, REQUEST=None): """Delete one or more properties specified by 'ids'.""" if ids is None: return MessageDialog( title='No property specified', message='No properties were specified!', action ='./manage_propertiesForm',) propdict=self.propdict() vself=self.v_self() if hasattr(vself,...
2,972
def setProperty(self, id, value, type='string', meta=None): raise ValueError, 'Property cannot be set.'
def _setProperty(self, id, value, type='string', meta=None): raise ValueError, 'Property cannot be set.'
2,973
def updateProperty(self, id, value): raise ValueError, 'Property cannot be set.'
def _updateProperty(self, id, value): raise ValueError, 'Property cannot be set.'
2,974
def delProperty(self, id): raise ValueError, 'Property cannot be deleted.'
def _delProperty(self, id): raise ValueError, 'Property cannot be deleted.'
2,975
def parse_text(s): if find(s,'\\') < 0 or (find(s,'\\t') < 0 and find(s,'\\n') < 0): return s r=[] for x in split(s,'\\\\'): x=join(split(x,'\\n'),'\n') r.append(join(split(x,'\\t'),'\t')) return join(r,'\\')
def parse_text(s): if find(s,'\\') < 0 and (find(s,'\\t') < 0 and find(s,'\\n') < 0): return s r=[] for x in split(s,'\\\\'): x=join(split(x,'\\n'),'\n') r.append(join(split(x,'\\t'),'\t')) return join(r,'\\')
2,976
def LOG(subsystem, severity, summary, detail='', error=None, reraise=None): """Log some information The required arguments are: subsystem -- The subsystem generating the message (e.g. ZODB) severity -- The "severity" of the event. This may be an integer or a floating point number. Logging back ends may consider th...
def LOG(subsystem, severity, summary, detail='', error=None, reraise=None): """Log some information The required arguments are: subsystem -- The subsystem generating the message (e.g. ZODB) severity -- The "severity" of the event. This may be an integer or a floating point number. Logging back ends may consider th...
2,977
def dav__source(self): vself=self.v_self() if hasattr(vself, 'meta_type') and vself.meta_type in \ ('Document', 'DTML Document', 'DTML Method'): url=vself.absolute_url() return '\n <n:src>%s</n:src>\n' \ ' <n:dst>%s/document_src</n:dst>\n ' % (url, url) return ''
def dav__source(self): vself=self.v_self() if hasattr(vself, 'meta_type') and vself.meta_type in \ ('Document', 'DTML Document', 'DTML Method'): url=vself.absolute_url() return '\n <n:link>\n' \ ' <n:src>%s</n:src>\n' \ ' <n:dst>%s/document_src</n:dst>\n' \ ' </n:link>\n ' % (url, url) return ''
2,978
def add(self, id, title='', smtp_host=None, smtp_port=25, REQUEST=None): ' add a MailHost into the system ' i=MailHost() #create new mail host i.id=id #give it id i.title=title #title i._init(smtpHost=smtp_host, smtpPort=smtp_port) self._setObject(id,i) #register it if REQUEST: re...
def add(self, id, title='', smtp_host=None, smtp_port=25, REQUEST=None): ' add a MailHost into the system ' i=MailHost() #create new mail host i.id=id #give it id i.title=title #title i._init(smtp_host=smtp_host, smtp_port=smtp_port) self._setObject(id,i) #register it if REQUEST: ...
2,979
def _init(self, smtpHost, smtpPort): self.smtpHost=smtpHost self.smtpPort=smtpPort
def _init(self, smtpHost, smtpPort): self.smtpHost=smtpHost self.smtpPort=smtpPort
2,980
def manage_makeChanges(self,title,smtpHost,smtpPort, REQUEST=None): 'make the changes' self.title=title self.smtpHost=smtpHost self.smtpPort=smtpPort if REQUEST: return MessageDialog( title ='Changed %s' % self.__name__, message='%s has been updated' % self.id, action =REQUEST['URL2']+'/manage_main', target ='manage_m...
def manage_makeChanges(self,title,smtpHost,smtpPort, REQUEST=None): 'make the changes' self.title=title self.smtp_host=smtp_host self.smtp_port=smtp_port if REQUEST: return MessageDialog( title ='Changed %s' % self.__name__, message='%s has been updated' % self.id, action =REQUEST['URL2']+'/manage_main', target ='mana...
2,981
def sendTemplate(trueself, self, messageTemplate, statusTemplate=None, mto=None, mfrom=None, encode=None, REQUEST=None): 'render a mail template, then send it...' mtemplate = getattr(self, messageTemplate) messageText = mtemplate(self, trueself.REQUEST) messageText=_encode(messageText, encode) headers = extractheaders(...
def sendTemplate(trueself, self, messageTemplate, statusTemplate=None, mto=None, mfrom=None, encode=None, REQUEST=None): 'render a mail template, then send it...' mtemplate = getattr(self, messageTemplate) messageText = mtemplate(self, trueself.REQUEST) messageText=_encode(messageText, encode) headers = extractheaders(...
2,982
def send(self, messageText, mto=None, mfrom=None, subject=None, encode=None): headers = extractheaders(messageText) if not headers['subject']: messageText="subject: %s\n%s" % (subject or '[No Subject]', messageText) if mto: if type(mto) is type('s'): mto=map(string.strip, string.split(mto,',')) headers['to'] = filter(...
def send(self, messageText, mto=None, mfrom=None, subject=None, encode=None): headers = extractheaders(messageText) if not headers['subject']: messageText="subject: %s\n%s" % (subject or '[No Subject]', messageText) if mto: if type(mto) is type('s'): mto=map(string.strip, string.split(mto,',')) headers['to'] = filter(...
2,983
def scheduledSend(self, messageText, mto=None, mfrom=None, subject=None, encode=None): headers = extractheaders(messageText)
def scheduledSend(self, messageText, mto=None, mfrom=None, subject=None, encode=None): headers = extractheaders(messageText)
2,984
def simple_send(self, mto, mfrom, subject, body): body="from: %s\nto: %s\nsubject: %s\n\n%s" % ( mfrom, mto, subject, body) mailserver = SMTP(self.smtphost, self.smtpport) mailserver.sendmail(mfrom, mto, body)
def simple_send(self, mto, mfrom, subject, body): body="from: %s\nto: %s\nsubject: %s\n\n%s" % ( mfrom, mto, subject, body) mailserver = SMTP(self.smtp_host, self.smtp_port) mailserver.sendmail(mfrom, mto, body)
2,985
def main(argv): short_options = ':u:p:e:d:' long_options = ['username=', 'password=', 'encoding=', 'domains='] usage = """%s [options] filename
def main(argv): short_options = ':u:p:e:d:' long_options = ['username=', 'password=', 'encoding=', 'domains='] usage = """%s [options] filename
2,986
def fancy_replace(a, alo, ahi, b, blo, bhi): if TRACE: print '*** fancy_replace', alo, ahi, blo, bhi dump('>', a, alo, ahi) dump('<', b, blo, bhi) # don't synch up unless the lines have a similarity score of at # least cutoff; best_ratio tracks the best score seen so far best_ratio, cutoff = 0.74, 0.75 cruncher = Sequ...
def fancy_replace(a, alo, ahi, b, blo, bhi): if TRACE: print '*** fancy_replace', alo, ahi, blo, bhi dump('>', a, alo, ahi) dump('<', b, blo, bhi) # don't synch up unless the lines have a similarity score of at # least cutoff; best_ratio tracks the best score seen so far best_ratio, cutoff = 0.74, 0.75 cruncher = Sequ...
2,987
def v_self(self): return self.aq_parent.aq_parent
def v_self(self): return self.aq_parent.aq_parent
2,988
def dav__getlastmodified(self): vself=self.v_self() if hasattr(vself, '_p_mtime'): return rfc1123_date(vself._p_mtime) return ''
def dav__getlastmodified(self): vself=self.v_self() if hasattr(vself, '_p_mtime'): return rfc1123_date(vself._p_mtime) return ''
2,989
def finish_starttag(self, tag, attrs): self.scan_xmlns(attrs) if tag in EMPTY_HTML_TAGS: print "<%s>" % tag self.pop_xmlns() elif tag in CLOSING_BLOCK_LEVEL_HTML_TAGS: close_to = -1 for i in range(len(self.tagstack)): t = self.tagstack[i] if t in CLOSING_BLOCK_LEVEL_HTML_TAGS: close_to = i elif t in BLOCK_LEVEL_HTML_TA...
def finish_starttag(self, tag, attrs): self.scan_xmlns(attrs) if tag in EMPTY_HTML_TAGS: self.pop_xmlns() elif tag in CLOSING_BLOCK_LEVEL_HTML_TAGS: close_to = -1 for i in range(len(self.tagstack)): t = self.tagstack[i] if t in CLOSING_BLOCK_LEVEL_HTML_TAGS: close_to = i elif t in BLOCK_LEVEL_HTML_TAGS: close_to = -1 s...
2,990
def finish_starttag(self, tag, attrs): self.scan_xmlns(attrs) if tag in EMPTY_HTML_TAGS: print "<%s>" % tag self.pop_xmlns() elif tag in CLOSING_BLOCK_LEVEL_HTML_TAGS: close_to = -1 for i in range(len(self.tagstack)): t = self.tagstack[i] if t in CLOSING_BLOCK_LEVEL_HTML_TAGS: close_to = i elif t in BLOCK_LEVEL_HTML_TA...
def finish_starttag(self, tag, attrs): self.scan_xmlns(attrs) if tag in EMPTY_HTML_TAGS: print "<%s>" % tag self.pop_xmlns() elif tag in CLOSING_BLOCK_LEVEL_HTML_TAGS: close_to = -1 for i in range(len(self.tagstack)): t = self.tagstack[i] if t in CLOSING_BLOCK_LEVEL_HTML_TAGS: close_to = i elif t in BLOCK_LEVEL_HTML_TA...
2,991
def _close_to_level(self, close_to): if close_to > -1: closing = self.tagstack[close_to:] closing.reverse() for t in closing: self.finish_endtag(t)
def _close_to_level(self, close_to): if close_to > -1: closing = self.tagstack[close_to:] closing.reverse() for t in closing: self.finish_endtag(t)
2,992
def finish_endtag(self, tag): if tag not in EMPTY_HTML_TAGS: assert tag in self.tagstack while self.tagstack[-1] != tag: self.finish_endtag(self.tagstack[-1]) self.tagstack.pop() self.pop_xmlns() self.gen.emitEndTag(tag)
def finish_endtag(self, tag): if tag not in EMPTY_HTML_TAGS: assert tag in self.tagstack while self.tagstack[-1] != tag: self.finish_endtag(self.tagstack[-1]) self.tagstack.pop() self.pop_xmlns() self.gen.emitEndTag(tag)
2,993
def raise_standardErrorMessage( self, client=None, REQUEST={}, error_type=None, error_value=None, tb=None, error_tb=None, error_message='', tagSearch=regex.compile('[a-zA-Z]>').search):
def raise_standardErrorMessage( self, client=None, REQUEST={}, error_type=None, error_value=None, tb=None, error_tb=None, error_message='', tagSearch=regex.compile('[a-zA-Z]>').search):
2,994
def test(*args, **kw): return apply(ZPublisher.test,('Zope',)+args, kw)
def debug(*args, **kw): return apply(ZPublisher.test,('Zope',)+args, kw)
2,995
def appendCookie(self, name, value):
def appendCookie(self, name, value):
2,996
def expireCookie(self, name):
def expireCookie(self, name):
2,997
def setCookie(self,name,value,**kw):
def setCookie(self,name,value,**kw):
2,998
def setCookie(self,name,value,**kw):
def setCookie(self,name,value,**kw):
2,999