bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def shownode(self, message=None): ''' display an item ''' cn = self.classname cl = self.db.classes[cn]
def shownode(self, message=None): ''' display an item ''' cn = self.classname cl = self.db.classes[cn]
34,100
def newuser(self, message=None): ''' Add a new user to the database.
def newuser(self, message=None): ''' Add a new user to the database.
34,101
def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised
def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised
34,102
def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised
def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised
34,103
def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised
def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised
34,104
def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised
def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised
34,105
def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised
def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised
34,106
def newuser_action(self, message=None): '''Attempt to create a new user based on the contents of the form and then set the cookie.
def newuser_action(self, message=None): '''Attempt to create a new user based on the contents of the form and then set the cookie.
34,107
def logout(self, message=None): self.make_user_anonymous() # construct the logout cookie now = Cookie._getdate() path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'])) self.header({'Set-Cookie': 'roundup_user=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) self.login()
deflogout(self,message=None):self.make_user_anonymous()#constructthelogoutcookienow=Cookie._getdate()path='/'.join((self.env['SCRIPT_NAME'],self.env['INSTANCE_NAME']))self.header({'Set-Cookie':'roundup_user=deleted;Max-Age=0;expires=%s;Path=%s;'%(now,path)})self.login()
34,108
def parsePropsFromForm(db, cl, form, nodeid=0): '''Pull properties for the given class out of the form. ''' props = {} changed = {} keys = form.keys() num_re = re.compile('^\d+$') for key in keys: if not cl.properties.has_key(key): continue proptype = cl.properties[key] if isinstance(proptype, hyperdb.String): value = ...
def parsePropsFromForm(db, cl, form, nodeid=0): '''Pull properties for the given class out of the form. ''' props = {} keys = form.keys() num_re = re.compile('^\d+$') for key in keys: if not cl.properties.has_key(key): continue proptype = cl.properties[key] if isinstance(proptype, hyperdb.String): value = form[key].val...
34,109
def parsePropsFromForm(db, cl, form, nodeid=0): '''Pull properties for the given class out of the form. ''' props = {} changed = {} keys = form.keys() num_re = re.compile('^\d+$') for key in keys: if not cl.properties.has_key(key): continue proptype = cl.properties[key] if isinstance(proptype, hyperdb.String): value = ...
def parsePropsFromForm(db, cl, form, nodeid=0): '''Pull properties for the given class out of the form. ''' props = {} changed = {} keys = form.keys() num_re = re.compile('^\d+$') for key in keys: if not cl.properties.has_key(key): continue proptype = cl.properties[key] if isinstance(proptype, hyperdb.String): value = ...
34,110
def parsePropsFromForm(db, cl, form, nodeid=0): '''Pull properties for the given class out of the form. ''' props = {} changed = {} keys = form.keys() num_re = re.compile('^\d+$') for key in keys: if not cl.properties.has_key(key): continue proptype = cl.properties[key] if isinstance(proptype, hyperdb.String): value = ...
def parsePropsFromForm(db, cl, form, nodeid=0): '''Pull properties for the given class out of the form. ''' props = {} changed = {} keys = form.keys() num_re = re.compile('^\d+$') for key in keys: if not cl.properties.has_key(key): continue proptype = cl.properties[key] if isinstance(proptype, hyperdb.String): value = ...
34,111
def parsePropsFromForm(db, cl, form, nodeid=0): '''Pull properties for the given class out of the form. ''' props = {} changed = {} keys = form.keys() num_re = re.compile('^\d+$') for key in keys: if not cl.properties.has_key(key): continue proptype = cl.properties[key] if isinstance(proptype, hyperdb.String): value = ...
def parsePropsFromForm(db, cl, form, nodeid=0): '''Pull properties for the given class out of the form. ''' props = {} changed = {} keys = form.keys() num_re = re.compile('^\d+$') for key in keys: if not cl.properties.has_key(key): continue proptype = cl.properties[key] if isinstance(proptype, hyperdb.String): value = ...
34,112
def setid(self, classname, maxid): ''' No-op in metakit ''' pass
def setid(self, classname, maxid): ''' No-op in metakit ''' pass
34,113
def get(self, nodeid, propname, default=_marker, cache=1): x = Class.get(self, nodeid, propname, default) poss_msg = 'Possibly an access right configuration problem.' if propname == 'content': if x.startswith('file:'): fnm = x[5:] try: x = open(fnm, 'rb').read() except IOError, (strerror): # XXX by catching this we don...
def get(self, nodeid, propname, default=_marker, cache=1): x = Class.get(self, nodeid, propname, default) poss_msg = 'Possibly an access right configuration problem.' if propname == 'content': if x.startswith('file:'): fnm = x[5:] try: f = open(fnm, 'rb') except IOError, (strerror): # XXX by catching this we donot see ...
34,114
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,115
def history(self, direction='descending'): l = ['<table width=100% border=0 cellspacing=0 cellpadding=2>', '<tr class="list-header">', _('<th align=left><span class="list-item">Date</span></th>'), _('<th align=left><span class="list-item">User</span></th>'), _('<th align=left><span class="list-item">Action</span></th>'...
def history(self, direction='descending'): l = ['<table width=100% border=0 cellspacing=0 cellpadding=2>', '<tr class="list-header">', _('<th align=left><span class="list-item">Date</span></th>'), _('<th align=left><span class="list-item">User</span></th>'), _('<th align=left><span class="list-item">Action</span></th>'...
34,116
def history(self, direction='descending'): l = ['<table width=100% border=0 cellspacing=0 cellpadding=2>', '<tr class="list-header">', _('<th align=left><span class="list-item">Date</span></th>'), _('<th align=left><span class="list-item">User</span></th>'), _('<th align=left><span class="list-item">Action</span></th>'...
def history(self, direction='descending'): l = ['<table width=100% border=0 cellspacing=0 cellpadding=2>', '<tr class="list-header">', _('<th align=left><span class="list-item">Date</span></th>'), _('<th align=left><span class="list-item">User</span></th>'), _('<th align=left><span class="list-item">Action</span></th>'...
34,117
def history(self, direction='descending'): l = ['<table width=100% border=0 cellspacing=0 cellpadding=2>', '<tr class="list-header">', _('<th align=left><span class="list-item">Date</span></th>'), _('<th align=left><span class="list-item">User</span></th>'), _('<th align=left><span class="list-item">Action</span></th>'...
def history(self, direction='descending'): l = ['<table width=100% border=0 cellspacing=0 cellpadding=2>', '<tr class="list-header">', _('<th align=left><span class="list-item">Date</span></th>'), _('<th align=left><span class="list-item">User</span></th>'), _('<th align=left><span class="list-item">Action</span></th>'...
34,118
def do_plain(self, property, escape=0): ''' display a String property directly;
def do_plain(self, property, escape=0): ''' display a String property directly;
34,119
def do_plain(self, property, escape=0): ''' display a String property directly;
def do_plain(self, property, escape=0): ''' display a String property directly;
34,120
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] install...
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] install...
34,121
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] install...
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] install...
34,122
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] install...
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] install...
34,123
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] install...
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] install...
34,124
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] install...
def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] install...
34,125
def pretty(self, format='%d %B %Y'): ''' print up the date date using a pretty format...
def pretty(self, format='%d %B %Y'): ''' print up the date date using a pretty format...
34,126
def hasPermission(self, permission, classname=_marker, property=None, itemid=None): '''Determine if the user has the Permission.
def hasPermission(self, permission, classname=_marker, property=None, itemid=None): '''Determine if the user has the Permission.
34,127
def __len__(self): return reduce(operator.add, [len(x) for x in stores], 0)
def __len__(self): return reduce(operator.add, [len(x) for x in stores], 0)
34,128
def push(self, store): self.stores.append(store)
def push(self, store): self.stores.append(store)
34,129
def handle_Message(self, message): '''Handle an RFC822 Message
def handle_Message(self, message): '''Handle an RFC822 Message
34,130
def handle_Message(self, message): '''Handle an RFC822 Message
def handle_Message(self, message): '''Handle an RFC822 Message
34,131
def handle_Message(self, message): '''Handle an RFC822 Message
def handle_Message(self, message): '''Handle an RFC822 Message
34,132
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,133
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,134
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,135
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,136
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,137
def open(name=None): ''' as from the roundupdb method openDB ''' from roundup.hyperdb import String, Password, Date, Link, Multilink from roundup.hyperdb import Interval, Boolean, Number # open the database db = Database(config, name) # # Now initialise the schema. Must do this each time the database is # opened. # ...
def open(name=None): ''' as from the roundupdb method openDB ''' from roundup.hyperdb import String, Password, Date, Link, Multilink from roundup.hyperdb import Interval, Boolean, Number # open the database db = Database(config, name) # # Now initialise the schema. Must do this each time the database is # opened. # ...
34,138
def getuid(self): """Return the id of the "user" node associated with the user that owns this connection to the hyperdatabase.""" if self.journaltag is None: return None elif self.journaltag == 'admin': # admin user may not exist, but always has ID 1 return '1' else: return self.user.lookup(self.journaltag)
def getuid(self): """Return the id of the "user" node associated with the user that owns this connection to the hyperdatabase.""" if self.journaltag is None: return None elif self.journaltag == 'admin': # admin user may not exist, but always has ID 1 return '1' else: return self.user.lookup(self.journaltag)
34,139
def searchAction(self, wcre=re.compile(r'[\s,]+')): ''' Mangle some of the form variables.
def searchAction(self, wcre=re.compile(r'[\s,]+')): ''' Mangle some of the form variables.
34,140
def initialize(context): context.registerClass( ZRoundup, meta_type = 'Z Roundup', constructors = ( ZRoundup.manage_addZRoundupForm, ZRoundup.manage_addZRoundup ) )
def initialize(context): context.registerClass( ZRoundup, meta_type = 'Z Roundup', constructors = ( ZRoundup.manage_addZRoundupForm, ZRoundup.manage_addZRoundup ) )
34,141
def initialize(context): context.registerClass( ZRoundup, meta_type = 'Z Roundup', constructors = ( ZRoundup.manage_addZRoundupForm, ZRoundup.manage_addZRoundup ) )
def initialize(context): context.registerClass( ZRoundup, meta_type = 'Z Roundup', constructors = ( manage_addZRoundupForm, manage_addZRoundup ) )
34,142
def inner_main(self): ''' Process a request.
def inner_main(self): ''' Process a request.
34,143
def serve_static_file(self, file): ims = None # see if there's an if-modified-since... if hasattr(self.request, 'headers'): ims = self.request.headers.getheader('if-modified-since') elif self.env.has_key('HTTP_IF_MODIFIED_SINCE'): # cgi will put the header in the env var ims = self.env['HTTP_IF_MODIFIED_SINCE'] filenam...
def serve_static_file(self, file): ims = None # see if there's an if-modified-since... if hasattr(self.request, 'headers'): ims = self.request.headers.getheader('if-modified-since') elif self.env.has_key('HTTP_IF_MODIFIED_SINCE'): # cgi will put the header in the env var ims = self.env['HTTP_IF_MODIFIED_SINCE'] filenam...
34,144
def serve_static_file(self, file): ims = None # see if there's an if-modified-since... if hasattr(self.request, 'headers'): ims = self.request.headers.getheader('if-modified-since') elif self.env.has_key('HTTP_IF_MODIFIED_SINCE'): # cgi will put the header in the env var ims = self.env['HTTP_IF_MODIFIED_SINCE'] filenam...
def serve_static_file(self, file): ims = None # see if there's an if-modified-since... if hasattr(self.request, 'headers'): ims = self.request.headers.getheader('if-modified-since') elif self.env.has_key('HTTP_IF_MODIFIED_SINCE'): # cgi will put the header in the env var ims = self.env['HTTP_IF_MODIFIED_SINCE'] filenam...
34,145
def searchAction(self): ''' Mangle some of the form variables.
def searchAction(self): ''' Mangle some of the form variables.
34,146
def now(self, str_interval = None): ''' Return the current time.
def now(self, str_interval=None): ''' Return the current time.
34,147
def field(self, size = 30, default = None): ''' Render a form edit field for the property
def field(self, size=30, default=None): ''' Render a form edit field for the property
34,148
def field(self, size = 30, default = None): ''' Render a form edit field for the property
def field(self, size = 30, default = None): ''' Render a form edit field for the property
34,149
def updateFromURL(self, url): ''' Parse the URL for query args, and update my attributes using the values. ''' self.form = {} for name, value in cgi.parse_qsl(url): if self.form.has_key(name): if isinstance(self.form[name], type([])): self.form[name].append(cgi.MiniFieldStorage(name, value)) else: self.form[name] = [se...
def updateFromURL(self, url): ''' Parse the URL for query args, and update my attributes using the values. ''' env = {'QUERY_STRING': url} self.form = cgi.FieldStorage(environ=env) self._post_init()
34,150
def run_demo(home): """Run the demo tracker installed in ``home``""" roundup_server.RoundupRequestHandler.TRACKER_HOMES = {'demo': home} cfg = configuration.CoreConfig(home) url = cfg["TRACKER_WEB"] hostname, port = urlparse.urlparse(url)[1].split(':') port = int(port) success_message = '''Server running - connect to: ...
def run_demo(home): """Run the demo tracker installed in ``home``""" cfg = configuration.CoreConfig(home) url = cfg["TRACKER_WEB"] hostname, port = urlparse.urlparse(url)[1].split(':') port = int(port) success_message = '''Server running - connect to: %s
34,151
def run_demo(home): """Run the demo tracker installed in ``home``""" roundup_server.RoundupRequestHandler.TRACKER_HOMES = {'demo': home} cfg = configuration.CoreConfig(home) url = cfg["TRACKER_WEB"] hostname, port = urlparse.urlparse(url)[1].split(':') port = int(port) success_message = '''Server running - connect to: ...
def run_demo(home): """Run the demo tracker installed in ``home``""" roundup_server.RoundupRequestHandler.TRACKER_HOMES = {'demo': home} cfg = configuration.CoreConfig(home) url = cfg["TRACKER_WEB"] hostname, port = urlparse.urlparse(url)[1].split(':') port = int(port) success_message = '''Server running - connect to: ...
34,152
def _opendb(self): '''Open the roundup instance database for a transaction. ''' instance = roundup.instance.open(self.instance_home) request = RequestWrapper(self.REQUEST['RESPONSE']) env = self.REQUEST.environ
def _opendb(self): '''Open the roundup instance database for a transaction. ''' instance = roundup.instance.open(self.instance_home) request = RequestWrapper(self.REQUEST['RESPONSE']) env = self.REQUEST.environ
34,153
def create_journal_table(self, spec): ''' create the journal table for a class given the spec and already-determined cols ''' # journal table cols = ','.join(['%s varchar'%x for x in 'nodeid date tag action params'.split()]) sql = '''create table %s__journal ( nodeid integer, date timestamp, tag varchar(255), action va...
def create_journal_table(self, spec): ''' create the journal table for a class given the spec and already-determined cols ''' # journal table cols = ','.join(['%s varchar'%x for x in 'nodeid date tag action params'.split()]) sql = '''create table %s__journal ( nodeid integer, date timestamp, tag varchar(255), action va...
34,154
def addjournal(self, classname, nodeid, action, params, creator=None, creation=None): ''' Journal the Action 'action' may be:
def addjournal(self, classname, nodeid, action, params, creator=None, creation=None): ''' Journal the Action 'action' may be:
34,155
def setjournal(self, classname, nodeid, journal): '''Set the journal to the "journal" list.''' # clear out any existing entries self.sql('delete from %s__journal where nodeid=%s'%(classname, self.arg), (nodeid,))
def setjournal(self, classname, nodeid, journal): '''Set the journal to the "journal" list.''' # clear out any existing entries self.sql('delete from %s__journal where nodeid=%s'%(classname, self.arg), (nodeid,))
34,156
def close(self): ''' Close off the connection. ''' self.indexer.close() self.sql_close()
def close(self): ''' Close off the connection. ''' self.indexer.close() self.sql_close()
34,157
def create(self, **propvalues): ''' Create a new node of this class and return its id.
def create(self, **propvalues): ''' Create a new node of this class and return its id.
34,158
def create(self, **propvalues): ''' Create a new node of this class and return its id.
def create(self, **propvalues): ''' Create a new node of this class and return its id.
34,159
def create(self, **propvalues): ''' Create a new node of this class and return its id.
def create(self, **propvalues): ''' Create a new node of this class and return its id.
34,160
def create(self, **propvalues): ''' Create a new node of this class and return its id.
def create(self, **propvalues): ''' Create a new node of this class and return its id.
34,161
def set(self, nodeid, **propvalues): '''Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised.
def set(self, nodeid, **propvalues): '''Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised.
34,162
def set(self, nodeid, **propvalues): '''Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised.
def set(self, nodeid, **propvalues): '''Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised.
34,163
def set_inner(self, nodeid, **propvalues): ''' Called by set, in-between the audit and react calls. ''' if not propvalues: return propvalues
def set_inner(self, nodeid, **propvalues): ''' Called by set, in-between the audit and react calls. ''' if not propvalues: return propvalues
34,164
def retire(self, nodeid): '''Retire a node. The properties on the node remain available from the get() method, and the node's id is never reused. Retired nodes are not returned by the find(), list(), or lookup() methods, and other nodes may reuse the values of their key properties. ''' if self.db.journaltag is None: ...
def retire(self, nodeid): '''Retire a node. The properties on the node remain available from the get() method, and the node's id is never reused. Retired nodes are not returned by the find(), list(), or lookup() methods, and other nodes may reuse the values of their key properties. ''' if self.db.journaltag is None: ...
34,165
def retire(self, nodeid): '''Retire a node. The properties on the node remain available from the get() method, and the node's id is never reused. Retired nodes are not returned by the find(), list(), or lookup() methods, and other nodes may reuse the values of their key properties. ''' if self.db.journaltag is None: ...
def retire(self, nodeid): '''Retire a node. The properties on the node remain available from the get() method, and the node's id is never reused. Retired nodes are not returned by the find(), list(), or lookup() methods, and other nodes may reuse the values of their key properties. ''' if self.db.journaltag is None: ...
34,166
def restore(self, nodeid): '''Restore a retired node.
def restore(self, nodeid): '''Restore a retired node.
34,167
def destroy(self, nodeid): '''Destroy a node. WARNING: this method should never be used except in extremely rare situations where there could never be links to the node being deleted
def destroy(self, nodeid): '''Destroy a node. WARNING: this method should never be used except in extremely rare situations where there could never be links to the node being deleted
34,168
def stringFind(self, **requirements): '''Locate a particular node by matching a set of its String properties in a caseless search.
def stringFind(self, **requirements): '''Locate a particular node by matching a set of its String properties in a caseless search.
34,169
def getnodeids(self, retired=None): ''' Retrieve all the ids of the nodes for a particular Class.
def getnodeids(self, retired=None): ''' Retrieve all the ids of the nodes for a particular Class.
34,170
def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None)): '''Return a list of the ids of the active nodes in this class that match the 'filter' spec, sorted by the group spec and then the sort spec
def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None)): '''Return a list of the ids of the active nodes in this class that match the 'filter' spec, sorted by the group spec and then the sort spec
34,171
def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None)): '''Return a list of the ids of the active nodes in this class that match the 'filter' spec, sorted by the group spec and then the sort spec
def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None)): '''Return a list of the ids of the active nodes in this class that match the 'filter' spec, sorted by the group spec and then the sort spec
34,172
def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None)): '''Return a list of the ids of the active nodes in this class that match the 'filter' spec, sorted by the group spec and then the sort spec
def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None)): '''Return a list of the ids of the active nodes in this class that match the 'filter' spec, sorted by the group spec and then the sort spec
34,173
def import_list(self, propnames, proplist): ''' Import a node - all information including "id" is present and should not be sanity checked. Triggers are not triggered. The journal should be initialised using the "creator" and "created" information.
def import_list(self, propnames, proplist): ''' Import a node - all information including "id" is present and should not be sanity checked. Triggers are not triggered. The journal should be initialised using the "creator" and "created" information.
34,174
def import_journals(self, entries): '''Import a class's journal. Uses setjournal() to set the journal for each item.''' properties = self.getprops() d = {} for l in entries: l = map(eval, l) nodeid, jdate, user, action, params = l r = d.setdefault(nodeid, []) if action == 'set': for propname, value in params.items(): ...
def import_journals(self, entries): '''Import a class's journal. Uses setjournal() to set the journal for each item.''' properties = self.getprops() d = {} for l in entries: l = map(eval, l) nodeid, jdate, user, action, params = l r = d.setdefault(nodeid, []) if action == 'set': for propname, value in params.items(): ...
34,175
def ngettext(self, singular, plural, count): if count == 1: _msg = singular else: _msg = plural return self.gettext(_msg)
def ungettext(self, singular, plural, count): if count == 1: _msg = singular else: _msg = plural return self.gettext(_msg)
34,176
def ngettext(self, singular, plural, count): if count == 1: _msg = singular else: _msg = plural return self.gettext(_msg)
def ngettext(self, singular, plural, count): if count == 1: _msg = singular else: _msg = plural return self.gettext(_msg)
34,177
def get_translation(language=None, domain=DOMAIN): """Return Translation object for given language and domain""" if language: _languages = [language] else: # use OS environment _languages = None # except for english ("en") language, add english fallback if available try: _fallback = translation(domain=domain, languages...
def get_translation(language=None, domain=DOMAIN): """Return Translation object for given language and domain""" if language: _languages = [language] else: # use OS environment _languages = None # except for english ("en") language, add english fallback if available try: _fallback = translation(domain=domain, languages...
34,178
def __init__(self, spec='.', offset=0, add_granularity=0, translator=i18n): """Construct a date given a specification and a time zone offset.
def __init__(self, spec='.', offset=0, add_granularity=0, translator=i18n): """Construct a date given a specification and a time zone offset.
34,179
def __init__(self, spec='.', offset=0, add_granularity=0, translator=i18n): """Construct a date given a specification and a time zone offset.
def __init__(self, spec='.', offset=0, add_granularity=0, translator=i18n): """Construct a date given a specification and a time zone offset.
34,180
def __init__(self, spec='.', offset=0, add_granularity=0, translator=i18n): """Construct a date given a specification and a time zone offset.
def __init__(self, spec='.', offset=0, add_granularity=0, translator=i18n): """Construct a date given a specification and a time zone offset.
34,181
def set(self, spec, offset=0, date_re=date_re, serialised_re=serialised_date_re, add_granularity=0): ''' set the date to the value in spec '''
def set(self, spec, offset=0, date_re=date_re, serialised_re=serialised_date_re, add_granularity=0): ''' set the date to the value in spec '''
34,182
def set(self, spec, offset=0, date_re=date_re, serialised_re=serialised_date_re, add_granularity=0): ''' set the date to the value in spec '''
def set(self, spec, offset=0, date_re=date_re, serialised_re=serialised_date_re, add_granularity=0): ''' set the date to the value in spec '''
34,183
def set(self, spec, offset=0, date_re=date_re, serialised_re=serialised_date_re, add_granularity=0): ''' set the date to the value in spec '''
def set(self, spec, offset=0, date_re=date_re, serialised_re=serialised_date_re, add_granularity=0): ''' set the date to the value in spec '''
34,184
def local(self, offset): """ Return this date as yyyy-mm-dd.hh:mm:ss in a local time zone. """ return Date((self.year, self.month, self.day, self.hour + offset, self.minute, self.second, 0, 0, 0), translator=self.translator)
def local(self, offset): """ Return this date as yyyy-mm-dd.hh:mm:ss in a local time zone. """ return Date((self.year, self.month, self.day, self.hour + offset, self.minute, self.second, 0, 0, 0), translator=self.translator)
34,185
def _serve_file(self, last_modified, mime_type, content): ''' guts of serve_file() and serve_static_file() ''' ims = None # see if there's an if-modified-since... if hasattr(self.request, 'headers'): ims = self.request.headers.getheader('if-modified-since') elif self.env.has_key('HTTP_IF_MODIFIED_SINCE'): # cgi will pu...
def _serve_file(self, lmt, mime_type, content): ''' guts of serve_file() and serve_static_file() ''' ims = None # see if there's an if-modified-since... if hasattr(self.request, 'headers'): ims = self.request.headers.getheader('if-modified-since') elif self.env.has_key('HTTP_IF_MODIFIED_SINCE'): # cgi will put the head...
34,186
def _serve_file(self, last_modified, mime_type, content): ''' guts of serve_file() and serve_static_file() ''' ims = None # see if there's an if-modified-since... if hasattr(self.request, 'headers'): ims = self.request.headers.getheader('if-modified-since') elif self.env.has_key('HTTP_IF_MODIFIED_SINCE'): # cgi will pu...
def _serve_file(self, last_modified, mime_type, content): ''' guts of serve_file() and serve_static_file() ''' ims = None # see if there's an if-modified-since... if hasattr(self.request, 'headers'): ims = self.request.headers.getheader('if-modified-since') elif self.env.has_key('HTTP_IF_MODIFIED_SINCE'): # cgi will pu...
34,187
def sendmessage(self, nodeid, msgid, change_note): """Send a message to the members of an issue's nosy list.
def sendmessage(self, nodeid, msgid, change_note): """Send a message to the members of an issue's nosy list.
34,188
def do_table(self, args): '''Usage: table classname [property[,property]*] List the instances of a class in tabular form.
def do_table(self, args): '''Usage: table classname [property[,property]*] List the instances of a class in tabular form.
34,189
def do_table(self, args): '''Usage: table classname [property[,property]*] List the instances of a class in tabular form.
def do_table(self, args): '''Usage: table classname [property[,property]*] List the instances of a class in tabular form.
34,190
def do_table(self, args): '''Usage: table classname [property[,property]*] List the instances of a class in tabular form.
def do_table(self, args): '''Usage: table classname [property[,property]*] List the instances of a class in tabular form.
34,191
def do_table(self, args): '''Usage: table classname [property[,property]*] List the instances of a class in tabular form.
def do_table(self, args): '''Usage: table classname [property[,property]*] List the instances of a class in tabular form.
34,192
def encode_header(header, charset='utf-8'): """ Will encode in quoted-printable encoding only if header contains non latin characters """ # Return empty headers unchanged if not header: return header # return plain header if it is not contains non-ascii characters if hqre.match(header): return header quoted = '' #ma...
def encode_header(header, charset='utf-8'): """ Will encode in quoted-printable encoding only if header contains non latin characters """ # Return empty headers unchanged if not header: return header # return plain header if it is not contains non-ascii characters if hqre.match(header): return header quoted = '' #ma...
34,193
def get(self, name, extension=None): ''' Interface to get a template, possibly loading a compiled template.
def get(self, name, extension=None): ''' Interface to get a template, possibly loading a compiled template.
34,194
def history(self, direction='descending', dre=re.compile('\d+')): l = ['<table class="history">' '<tr><th colspan="4" class="header">', _('History'), '</th></tr><tr>', _('<th>Date</th>'), _('<th>User</th>'), _('<th>Action</th>'), _('<th>Args</th>'), '</tr>'] current = {} comments = {} history = self._klass.history(self...
def history(self, direction='descending', dre=re.compile('\d+')): l = ['<table class="history">' '<tr><th colspan="4" class="header">', _('History'), '</th></tr><tr>', _('<th>Date</th>'), _('<th>User</th>'), _('<th>Action</th>'), _('<th>Args</th>'), '</tr>'] current = {} comments = {} history = self._klass.history(self...
34,195
def write(self, content): pass
def write(self, content): pass
34,196
def write(self, content): pass
def write(self, content): pass
34,197
def getnodeids(self, classname, db=None): '''Retrieve all the ids of the nodes for a particular Class. ''' raise NotImplementedError
def getnodeids(self, classname, db=None): '''Retrieve all the ids of the nodes for a particular Class. ''' raise NotImplementedError
34,198
def to_date(ts): return date.Date(time.gmtime(float(ts)))
def to_date(ts): return date.Date(time.gmtime(float(ts)))
34,199