bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def __init__(self, db, classname, **properties): #self.db = weakref.proxy(db) self.db = db self.classname = classname self.keyname = None self.ruprops = properties self.privateprops = { 'id' : hyperdb.String(), 'activity' : hyperdb.Date(), 'creation' : hyperdb.Date(), 'creator' : hyperdb.Link('user') }
defif (properties.has_key('creation') or properties.has_key('activity') or properties.has_key('creator')): raise ValueError, '"creation", "activity" and "creator" are '\ 'reserved' if hasattr(db, classname): raise ValueError, "Class %s already exists"%classname __init__(self,if (properties.has_key('creation') or prope...
34,200
def __init__(self, db, classname, **properties): #self.db = weakref.proxy(db) self.db = db self.classname = classname self.keyname = None self.ruprops = properties self.privateprops = { 'id' : hyperdb.String(), 'activity' : hyperdb.Date(), 'creation' : hyperdb.Date(), 'creator' : hyperdb.Link('user') }
def __init__(self, db, classname, **properties): #self.db = weakref.proxy(db) self.db = db self.classname = classname self.key = None self.ruprops = properties self.privateprops = { 'id' : hyperdb.String(), 'activity' : hyperdb.Date(), 'creation' : hyperdb.Date(), 'creator' : hyperdb.Link('user') }
34,201
def create_inner(self, **propvalues): rowdict = {} rowdict['id'] = newid = self.maxid self.maxid += 1 ndx = self.getview(1).append(rowdict) propvalues['#ISNEW'] = 1 try: self.set(str(newid), **propvalues) except Exception: self.maxid -= 1 raise return str(newid)
def create_inner(self, **propvalues): rowdict = {} rowdict['id'] = newid = self.maxid self.maxid += 1 ndx = self.getview(READWRITE).append(rowdict) propvalues['#ISNEW'] = 1 try: self.set(str(newid), **propvalues) except Exception: self.maxid -= 1 raise return str(newid)
34,202
def get(self, nodeid, propname, default=_marker, cache=1): ''' 'cache' exists for backwards compatibility, and is not used. '''
defget(self,nodeid,propname,default=_marker,cache=1):''''cache'existsforbackwardscompatibility,andisnotused.'''
34,203
def get(self, nodeid, propname, default=_marker, cache=1): ''' 'cache' exists for backwards compatibility, and is not used. '''
def get(self, nodeid, propname, default=_marker, cache=1): ''' 'cache' exists for backwards compatibility, and is not used. '''
34,204
def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not isnew: self.fireAuditors('set', nodeid, propvalues) if not propvalues: return propvalues if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise hyperdb....
def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not isnew: self.fireAuditors('set', nodeid, propvalues) if not propvalues: return propvalues if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise hyperdb....
34,205
def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not isnew: self.fireAuditors('set', nodeid, propvalues) if not propvalues: return propvalues if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise hyperdb....
def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not isnew: self.fireAuditors('set', nodeid, propvalues) if not propvalues: return propvalues if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise hyperdb....
34,206
def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not isnew: self.fireAuditors('set', nodeid, propvalues) if not propvalues: return propvalues if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise hyperdb....
def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not isnew: self.fireAuditors('set', nodeid, propvalues) if not propvalues: return propvalues if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise hyperdb....
34,207
def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not isnew: self.fireAuditors('set', nodeid, propvalues) if not propvalues: return propvalues if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise hyperdb....
def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not isnew: self.fireAuditors('set', nodeid, propvalues) if not propvalues: return propvalues if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise hyperdb....
34,208
def retire(self, nodeid): if self.db.journaltag is None: raise hyperdb.DatabaseError, 'Database open read-only' self.fireAuditors('retire', nodeid, None) view = self.getview(1) ndx = view.find(id=int(nodeid)) if ndx < 0: raise KeyError, "nodeid %s not found" % nodeid
def retire(self, nodeid): if self.db.journaltag is None: raise hyperdb.DatabaseError, 'Database open read-only' self.fireAuditors('retire', nodeid, None) view = self.getview(READWRITE) ndx = view.find(id=int(nodeid)) if ndx < 0: raise KeyError, "nodeid %s not found" % nodeid
34,209
def retire(self, nodeid): if self.db.journaltag is None: raise hyperdb.DatabaseError, 'Database open read-only' self.fireAuditors('retire', nodeid, None) view = self.getview(1) ndx = view.find(id=int(nodeid)) if ndx < 0: raise KeyError, "nodeid %s not found" % nodeid
def retire(self, nodeid): if self.db.journaltag is None: raise hyperdb.DatabaseError, 'Database open read-only' self.fireAuditors('retire', nodeid, None) view = self.getview(1) ndx = view.find(id=int(nodeid)) if ndx < 0: raise KeyError, "nodeid %s not found" % nodeid
34,210
def restore(self, nodeid): '''Restpre a retired node.
def restore(self, nodeid): '''Restpre a retired node.
34,211
def restore(self, nodeid): '''Restpre a retired node.
def restore(self, nodeid): '''Restpre a retired node.
34,212
def restore(self, nodeid): '''Restpre a retired node.
def restore(self, nodeid): '''Restpre a retired node.
34,213
def restore(self, nodeid): '''Restpre a retired node.
def restore(self, nodeid): '''Restpre a retired node.
34,214
def is_retired(self, nodeid): view = self.getview(1) # node must exist & not be retired id = int(nodeid) ndx = view.find(id=id) if ndx < 0: raise IndexError, "%s has no node %s" % (self.classname, nodeid) row = view[ndx] return row._isdel
def is_retired(self, nodeid): view = self.getview(READWRITE) # node must exist & not be retired id = int(nodeid) ndx = view.find(id=id) if ndx < 0: raise IndexError, "%s has no node %s" % (self.classname, nodeid) row = view[ndx] return row._isdel
34,215
def setkey(self, propname): if self.keyname: if propname == self.keyname: return raise ValueError, "%s already indexed on %s"%(self.classname, self.keyname) prop = self.properties.get(propname, None) if prop is None: prop = self.privateprops.get(propname, None) if prop is None: raise KeyError, "no property %s" % propna...
def setkey(self, propname): if self.key: if propname == self.key: return raise ValueError, "%s already indexed on %s"%(self.classname, self.keyname) prop = self.properties.get(propname, None) if prop is None: prop = self.privateprops.get(propname, None) if prop is None: raise KeyError, "no property %s" % propname if no...
34,216
def setkey(self, propname): if self.keyname: if propname == self.keyname: return raise ValueError, "%s already indexed on %s"%(self.classname, self.keyname) prop = self.properties.get(propname, None) if prop is None: prop = self.privateprops.get(propname, None) if prop is None: raise KeyError, "no property %s" % propna...
def setkey(self, propname): if self.keyname: if propname == self.keyname: return raise ValueError, "%s already indexed on %s"%(self.classname, self.key) prop = self.properties.get(propname, None) if prop is None: prop = self.privateprops.get(propname, None) if prop is None: raise KeyError, "no property %s" % propname i...
34,217
def setkey(self, propname): if self.keyname: if propname == self.keyname: return raise ValueError, "%s already indexed on %s"%(self.classname, self.keyname) prop = self.properties.get(propname, None) if prop is None: prop = self.privateprops.get(propname, None) if prop is None: raise KeyError, "no property %s" % propna...
def setkey(self, propname): if self.keyname: if propname == self.keyname: return raise ValueError, "%s already indexed on %s"%(self.classname, self.keyname) prop = self.properties.get(propname, None) if prop is None: prop = self.privateprops.get(propname, None) if prop is None: raise KeyError, "no property %s" % propna...
34,218
def getkey(self): return self.keyname
def getkey(self): return self.keyname
34,219
def lookup(self, keyvalue): if type(keyvalue) is not _STRINGTYPE: raise TypeError, "%r is not a string" % keyvalue iv = self.getindexview() if iv: ndx = iv.find(k=keyvalue) if ndx > -1: return str(iv[ndx].i) else: view = self.getview() ndx = view.find({self.keyname:keyvalue, '_isdel':0}) if ndx > -1: return str(view[nd...
def lookup(self, keyvalue): if type(keyvalue) is not _STRINGTYPE: raise TypeError, '%r is not a string'%keyvalue iv = self.getindexview() if iv: ndx = iv.find(k=keyvalue) if ndx > -1: return str(iv[ndx].i) else: view = self.getview() ndx = view.find({self.keyname:keyvalue, '_isdel':0}) if ndx > -1: return str...
34,220
def lookup(self, keyvalue): if type(keyvalue) is not _STRINGTYPE: raise TypeError, "%r is not a string" % keyvalue iv = self.getindexview() if iv: ndx = iv.find(k=keyvalue) if ndx > -1: return str(iv[ndx].i) else: view = self.getview() ndx = view.find({self.keyname:keyvalue, '_isdel':0}) if ndx > -1: return str(view[nd...
def lookup(self, keyvalue): if type(keyvalue) is not _STRINGTYPE: raise TypeError, "%r is not a string" % keyvalue iv = self.getindexview() if iv: ndx = iv.find(k=keyvalue) if ndx > -1: view = self.getview() ndx = view.find(id=iv[ndx].i) if ndx > -1: row = view[ndx] if not row._isdel: return str(row.id) else: view = se...
34,221
def lookup(self, keyvalue): if type(keyvalue) is not _STRINGTYPE: raise TypeError, "%r is not a string" % keyvalue iv = self.getindexview() if iv: ndx = iv.find(k=keyvalue) if ndx > -1: return str(iv[ndx].i) else: view = self.getview() ndx = view.find({self.keyname:keyvalue, '_isdel':0}) if ndx > -1: return str(view[nd...
def lookup(self, keyvalue): if type(keyvalue) is not _STRINGTYPE: raise TypeError, "%r is not a string" % keyvalue iv = self.getindexview() if iv: ndx = iv.find(k=keyvalue) if ndx > -1: return str(iv[ndx].i) else: view = self.getview() ndx = view.find({self.key:keyvalue}) if ndx > -1: return str(view[ndx].id) raise Key...
34,222
def lookup(self, keyvalue): if type(keyvalue) is not _STRINGTYPE: raise TypeError, "%r is not a string" % keyvalue iv = self.getindexview() if iv: ndx = iv.find(k=keyvalue) if ndx > -1: return str(iv[ndx].i) else: view = self.getview() ndx = view.find({self.keyname:keyvalue, '_isdel':0}) if ndx > -1: return str(view[nd...
def lookup(self, keyvalue): if type(keyvalue) is not _STRINGTYPE: raise TypeError, "%r is not a string" % keyvalue iv = self.getindexview() if iv: ndx = iv.find(k=keyvalue) if ndx > -1: return str(iv[ndx].i) else: view = self.getview() ndx = view.find({self.keyname:keyvalue, '_isdel':0}) if ndx > -1: row = view[ndx] if...
34,223
def destroy(self, id): view = self.getview(1) ndx = view.find(id=int(id)) if ndx > -1: if self.keyname: keyvalue = getattr(view[ndx], self.keyname) iv = self.getindexview(1) if iv: ivndx = iv.find(k=keyvalue) if ivndx > -1: iv.delete(ivndx) view.delete(ndx) self.db.destroyjournal(self.classname, id) self.db.dirty = 1
def destroy(self, id): view = self.getview(READWRITE) ndx = view.find(id=int(id)) if ndx > -1: if self.keyname: keyvalue = getattr(view[ndx], self.keyname) iv = self.getindexview(1) if iv: ivndx = iv.find(k=keyvalue) if ivndx > -1: iv.delete(ivndx) view.delete(ndx) self.db.destroyjournal(self.classname, id) self.db.dir...
34,224
def destroy(self, id): view = self.getview(1) ndx = view.find(id=int(id)) if ndx > -1: if self.keyname: keyvalue = getattr(view[ndx], self.keyname) iv = self.getindexview(1) if iv: ivndx = iv.find(k=keyvalue) if ivndx > -1: iv.delete(ivndx) view.delete(ndx) self.db.destroyjournal(self.classname, id) self.db.dirty = 1
def destroy(self, id): view = self.getview(1) ndx = view.find(id=int(id)) if ndx > -1: if self.key: keyvalue = getattr(view[ndx], self.key) iv = self.getindexview(READWRITE) if iv: ivndx = iv.find(k=keyvalue) if ivndx > -1: iv.delete(ivndx) view.delete(ndx) self.db.destroyjournal(self.classname, id) self.db.dirty = 1
34,225
def ff(row, nm=propname, ids=ids): sv = getattr(row, nm) for sr in sv: if ids.has_key(sr.fid): return 1 return 0
def ff(row, nm=propname, ids=ids): if not row._isdel: sv = getattr(row, nm) for sr in sv: if ids.has_key(sr.fid): return 1 return 0
34,226
def ff(row, nm=propname, ids=ids): return ids.has_key(getattr(row, nm))
def ff(row, nm=propname, ids=ids): return ids.has_key(getattr(row, nm))
34,227
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 "creation" 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 "creation" information.
34,228
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 "creation" 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 "creation" information.
34,229
def _clear(self): view = self.getview(1) if len(view): view[:] = [] self.db.dirty = 1 iv = self.getindexview(1) if iv: iv[:] = []
def _clear(self): view = self.getview(READWRITE) if len(view): view[:] = [] self.db.dirty = 1 iv = self.getindexview(1) if iv: iv[:] = []
34,230
def _clear(self): view = self.getview(1) if len(view): view[:] = [] self.db.dirty = 1 iv = self.getindexview(1) if iv: iv[:] = []
def _clear(self): view = self.getview(1) if len(view): view[:] = [] self.db.dirty = 1 iv = self.getindexview(READWRITE) if iv: iv[:] = []
34,231
def __getview(self): ''' Find the interface for a specific Class in the hyperdb.
def __getview(self): ''' Find the interface for a specific Class in the hyperdb.
34,232
def __getview(self): ''' Find the interface for a specific Class in the hyperdb.
def __getview(self): ''' Find the interface for a specific Class in the hyperdb.
34,233
def __getview(self): ''' Find the interface for a specific Class in the hyperdb.
def __getview(self): ''' Find the interface for a specific Class in the hyperdb.
34,234
def __getview(self): ''' Find the interface for a specific Class in the hyperdb.
def __getview(self): ''' Find the interface for a specific Class in the hyperdb.
34,235
def _fetchInterval(n): ''' Convert to a date.Interval unless the interval is '' which is our sentinel for "unset". ''' if n == '': return None return date.Interval(n)
def _fetchInterval(n): ''' Convert to a date.Interval unless the interval is '' which is our sentinel for "unset". ''' if n == '': return None return date.Interval(n)
34,236
def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' rest = self.path
def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' rest = self.path
34,237
def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' rest = self.path
def tracker = self.get_tracker(tracker_name) inner_run_cgi(self): tracker = self.get_tracker(tracker_name) ''' tracker = self.get_tracker(tracker_name) This tracker = self.get_tracker(tracker_name) is tracker = self.get_tracker(tracker_name) the tracker = self.get_tracker(tracker_name) inner tracker = self.get_tracker(...
34,238
def get_server(self): """Return HTTP server object to run""" # redirect stdout/stderr to our logfile # this is done early to have following messages go to this logfile if self["LOGFILE"]: # appending, unbuffered sys.stdout = sys.stderr = open(self["LOGFILE"], 'a', 0) # we don't want the cgi module interpreting the comm...
def get_server(self): """Return HTTP server object to run""" # redirect stdout/stderr to our logfile # this is done early to have following messages go to this logfile if self["LOGFILE"]: # appending, unbuffered sys.stdout = sys.stderr = open(self["LOGFILE"], 'a', 0) # we don't want the cgi module interpreting the comm...
34,239
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
34,240
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
34,241
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
34,242
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
34,243
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
34,244
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
34,245
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
def getbody(self): """Get the decoded message body.""" self.rewindbody() encoding = self.getencoding() data = None if encoding == 'base64': # BUG: is base64 really used for text encoding or # are we inserting zip files here. data = binascii.a2b_base64(self.fp.read()) elif encoding == 'quoted-printable': # the quopri mo...
34,246
def extract_content(self, parent_type=None): """Extract the body and the attachments recursively.""" content_type = self.gettype() content = None attachments = [] if content_type == 'text/plain': content = self.getbody() elif content_type[:10] == 'multipart/': for part in self.getparts(): new_content, new_attach = par...
def extract_content(self, parent_type=None): """Extract the body and the attachments recursively.""" content_type = self.gettype() content = None attachments = [] if content_type == 'text/plain': content = self.getbody() elif content_type[:10] == 'multipart/': for part in self.getparts(): new_content, new_attach = par...
34,247
def extract_content(self, parent_type=None): """Extract the body and the attachments recursively.""" content_type = self.gettype() content = None attachments = [] if content_type == 'text/plain': content = self.getbody() elif content_type[:10] == 'multipart/': for part in self.getparts(): new_content, new_attach = par...
def extract_content(self, parent_type=None): """Extract the body and the attachments recursively.""" content_type = self.gettype() content = None attachments = [] if content_type == 'text/plain': content = self.getbody() elif content_type[:10] == 'multipart/': for part in self.getparts(): new_content, new_attach = par...
34,248
def as_attachment(self): """Return this message as an attachment.""" return (self.getname(), self.gettype(), self.getbody())
def as_attachment(self): """Return this message as an attachment.""" return (self.getname(), self.gettype(), self.getbody())
34,249
def do_pop(self, server, user='', password='', apop=0): '''Read a series of messages from the specified POP server. ''' import getpass, poplib, socket try: if not user: user = raw_input('User: ') if not password: password = getpass.getpass() except (KeyboardInterrupt, EOFError): # Ctrl C or D maybe also Ctrl Z under Wi...
def do_pop(self, server, user='', password='', apop=0): '''Read a series of messages from the specified POP server. ''' import getpass, poplib, socket try: if not user: user = raw_input('User: ') if not password: password = getpass.getpass() except (KeyboardInterrupt, EOFError): # Ctrl C or D maybe also Ctrl Z under Wi...
34,250
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,251
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,252
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,253
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,254
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,255
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,256
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,257
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,258
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,259
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,260
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,261
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,262
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,263
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,264
def inner_main(self): '''Process a request.
def inner_main(self): '''Process a request.
34,265
def determine_context(self, dre=re.compile(r'([^\d]+)0*(\d+)')): """Determine the context of this page from the URL:
def determine_context(self, dre=re.compile(r'([^\d]+)0*(\d+)')): """Determine the context of this page from the URL:
34,266
def serve_file(self, designator, dre=re.compile(r'([^\d]+)(\d+)')): ''' Serve the file from the content property of the designated item. ''' m = dre.match(str(designator)) if not m: raise NotFound, str(designator) classname, nodeid = m.group(1), m.group(2)
def serve_file(self, designator, dre=re.compile(r'([^\d]+)(\d+)')): ''' Serve the file from the content property of the designated item. ''' m = dre.match(str(designator)) if not m: raise NotFound, str(designator) classname, nodeid = m.group(1), m.group(2)
34,267
def opendb(self, username): ''' Open the database and set the current user.
def opendb(self, username): ''' Open the database and set the current user.
34,268
def filter(self, search_matches, filterspec, sort=[], group=[]): '''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=[], group=[]): '''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,269
def _changenode(self, cn, nodeid, props): """Change the node based on the contents of the form.""" # check for permission if not self.editItemPermission(props): raise exceptions.Unauthorised, self._( 'You do not have permission to edit %(class)s' ) % {'class': cn}
def _changenode(self, cn, nodeid, props): """Change the node based on the contents of the form.""" # check for permission if not self.editItemPermission(props, classname=cn, itemid=nodeid): raise exceptions.Unauthorised, self._( 'You do not have permission to edit %(class)s' ) % {'class': cn}
34,270
def _createnode(self, cn, props): """Create a node based on the contents of the form.""" # check for permission if not self.newItemPermission(props): raise exceptions.Unauthorised, self._( 'You do not have permission to create %(class)s' ) % {'class': cn}
def _createnode(self, cn, props): """Create a node based on the contents of the form.""" # check for permission if not self.newItemPermission(props, classname=cn): raise exceptions.Unauthorised, self._( 'You do not have permission to create %(class)s' ) % {'class': cn}
34,271
def editItemPermission(self, props): """Determine whether the user has permission to edit this item.
_cn_marker = [] def editItemPermission(self, props, classname=_cn_marker, itemid=None): """Determine whether the user has permission to edit this item.
34,272
def editItemPermission(self, props): """Determine whether the user has permission to edit this item.
def editItemPermission(self, props): """Determine whether the user has permission to edit this item.
34,273
def newItemPermission(self, props): """Determine whether the user has permission to create this item.
def newItemPermission(self, props, classname=None): """Determine whether the user has permission to create this item.
34,274
def newItemPermission(self, props): """Determine whether the user has permission to create this item.
def newItemPermission(self, props): """Determine whether the user has permission to create this item.
34,275
def run_cgi(self): """ Execute the CGI command. Wrap an innner call in an error handler so all errors can be caught. """ save_stdin = sys.stdin sys.stdin = self.rfile try: self.inner_run_cgi() except client.NotFound: self.send_error(404, self.path) except client.Unauthorised, message: self.send_error(403, '%s (%s)'%(se...
def run_cgi(self): """ Execute the CGI command. Wrap an innner call in an error handler so all errors can be caught. """ save_stdin = sys.stdin sys.stdin = self.rfile try: self.inner_run_cgi() except client.NotFound: self.send_error(404, self.path) except client.Unauthorised, message: self.send_error(403, '%s (%s)'%(se...
34,276
def run_cgi(self): """ Execute the CGI command. Wrap an innner call in an error handler so all errors can be caught. """ save_stdin = sys.stdin sys.stdin = self.rfile try: self.inner_run_cgi() except client.NotFound: self.send_error(404, self.path) except client.Unauthorised, message: self.send_error(403, '%s (%s)'%(se...
def run_cgi(self): """ Execute the CGI command. Wrap an innner call in an error handler so all errors can be caught. """ save_stdin = sys.stdin sys.stdin = self.rfile try: self.inner_run_cgi() except client.NotFound: self.send_error(404, self.path) except client.Unauthorised, message: self.send_error(403, '%s (%s)'%(se...
34,277
def testGranularity(self): ae = self.assertEqual ae(str(Date('2003-2-12', add_granularity=1)), '2003-02-12.23:59:59') ae(str(Date('2003-1-1.23:00', add_granularity=1)), '2003-01-01.23:00:59') ae(str(Date('2003', add_granularity=1)), '2003-12-31.23:59:59') ae(str(Date('2003-5', add_granularity=1)), '2003-05-31.23:59:59'...
def testGranularity(self): ae = self.assertEqual ae(str(Date('2003-2-12', add_granularity=1)), '2003-02-12.23:59:59') ae(str(Date('2003-1-1.23:00', add_granularity=1)), '2003-01-01.23:00:59') ae(str(Date('2003', add_granularity=1)), '2003-12-31.23:59:59') ae(str(Date('2003-5', add_granularity=1)), '2003-05-31.23:59:59'...
34,278
def ae(spec, pretty): self.assertEqual(Interval(spec).pretty(), pretty)
def ae(spec, pretty): self.assertEqual(Interval(spec).pretty(), pretty)
34,279
def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(DateTestCase)) return suite
def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(DateTestCase)) return suite
34,280
def lock(file, flags): hfile = win32file._get_osfhandle(file.fileno()) win32file.LockFileEx(hfile, flags, 0, 0xffff0000, __overlapped)
def lock(file, flags): hfile = win32file._get_osfhandle(file.fileno()) win32file.LockFileEx(hfile, flags, 0, 0xffff0000, __overlapped)
34,281
def lock(file, flags): fcntl.flock(file.fileno(), flags)
def lock(file, flags): fcntl.flock(file.fileno(), flags)
34,282
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
34,283
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
34,284
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
34,285
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
34,286
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
34,287
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
def unlock(file): fcntl.flock(file.fileno(), fcntl.LOCK_UN)
34,288
def determine_user(self): ''' Determine who the user is ''' # determine the uid to use self.opendb('admin')
def determine_user(self): ''' Determine who the user is ''' # determine the uid to use self.opendb('admin')
34,289
def determine_user(self): ''' Determine who the user is ''' # determine the uid to use self.opendb('admin')
def determine_user(self): ''' Determine who the user is ''' # determine the uid to use self.opendb('admin')
34,290
def menu(self, size=None, height=None, showid=0, additional=[], value=None, sort_on=None, **conditions): ''' Render a form select list for this property
def menu(self, size=None, height=None, showid=0, additional=[], value=None, sort_on=None, **conditions): ''' Render a form select list for this property
34,291
def menu(self, size=None, height=None, showid=0, additional=[], value=None, sort_on=None, **conditions): ''' Render a form <select> list for this property.
def menu(self, size=None, height=None, showid=0, additional=[], value=None, sort_on=None, **conditions): ''' Render a form <select> list for this property.
34,292
def filter(self, search_matches, filterspec, sort=[], group=[]): '''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=[], group=[]): '''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,293
def filter(self, search_matches, filterspec, sort=[], group=[]): '''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=[], group=[]): '''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,294
def handle_message(self, message): ''' message - a Message instance
def handle_message(self, message): ''' message - a Message instance
34,295
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,296
def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form select list for this property
def menu(self, size=None, height=None, showid=0, additional=[], value=None, sort_on=None, **conditions): ''' Render a form select list for this property
34,297
def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form select list for this property
def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form select list for this property
34,298
def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form <select> list for this property.
def menu(self, size=None, height=None, showid=0, additional=[], value=None, sort_on=None, **conditions): ''' Render a form <select> list for this property.
34,299