bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | def pt_html(context=5): esc = cgi.escape l = ['<h1>Templating Error</h1>', '<p><b>%s</b>: %s</p>'%(esc(str(sys.exc_type)), esc(str(sys.exc_value))), '<p class="help">Debugging information follows</p>', '<ol>',] from roundup.cgi.PageTemplates.Expressions import TraversalError t = inspect.trace(context) t.reverse() for f... | 33,300 |
def html(context=5): etype, evalue = sys.exc_type, sys.exc_value if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + string.split(sys.version)[0] + '<br>' + sys.executable head = pydoc.html.heading( '<font size=+1><strong>%s</strong>: %s</font>'%(etype, evalue), '#ffffff', '#777777', pyver) h... | def html(context=5, i18n=None): _ = get_translator(i18n) etype, evalue = sys.exc_type, sys.exc_value if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + string.split(sys.version)[0] + '<br>' + sys.executable head = pydoc.html.heading( '<font size=+1><strong>%s</strong>: %s</font>'%(etype, eval... | 33,301 |
def html(context=5): etype, evalue = sys.exc_type, sys.exc_value if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + string.split(sys.version)[0] + '<br>' + sys.executable head = pydoc.html.heading( '<font size=+1><strong>%s</strong>: %s</font>'%(etype, evalue), '#ffffff', '#777777', pyver) h... | def html(context=5): etype, evalue = sys.exc_type, sys.exc_value if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + string.split(sys.version)[0] + '<br>' + sys.executable head = pydoc.html.heading( _('<font size=+1><strong>%(exc_type)s</strong>: %(exc_value)s</font>') % {'exc_type': etype, 'e... | 33,302 |
def html(context=5): etype, evalue = sys.exc_type, sys.exc_value if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + string.split(sys.version)[0] + '<br>' + sys.executable head = pydoc.html.heading( '<font size=+1><strong>%s</strong>: %s</font>'%(etype, evalue), '#ffffff', '#777777', pyver) h... | def html(context=5): etype, evalue = sys.exc_type, sys.exc_value if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + string.split(sys.version)[0] + '<br>' + sys.executable head = pydoc.html.heading( '<font size=+1><strong>%s</strong>: %s</font>'%(etype, evalue), '#ffffff', '#777777', pyver) h... | 33,303 |
def html(context=5): etype, evalue = sys.exc_type, sys.exc_value if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + string.split(sys.version)[0] + '<br>' + sys.executable head = pydoc.html.heading( '<font size=+1><strong>%s</strong>: %s</font>'%(etype, evalue), '#ffffff', '#777777', pyver) h... | def html(context=5): etype, evalue = sys.exc_type, sys.exc_value if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + string.split(sys.version)[0] + '<br>' + sys.executable head = pydoc.html.heading( '<font size=+1><strong>%s</strong>: %s</font>'%(etype, evalue), '#ffffff', '#777777', pyver) h... | 33,304 |
def setgid(group): if group is None: return if not hasattr(os, 'setgid'): return # if root, setgid to the running user if not os.getuid(): print _('WARNING: ignoring "-g" argument, not root') return try: import grp except ImportError: raise ValueError, _("Can't change groups - no grp module") try: try: gid = int(grou... | def setgid(group): if group is None: return if not hasattr(os, 'setgid'): return # if root, setgid to the running user if os.getuid(): print _('WARNING: ignoring "-g" argument, not root') return try: import grp except ImportError: raise ValueError, _("Can't change groups - no grp module") try: try: gid = int(group) e... | 33,305 |
def set_inner(self, nodeid, **propvalues): '''Called outside of auditors''' isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] | def set_inner(self, nodeid, **propvalues): '''Called outside of auditors''' isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] | 33,306 |
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 | 33,307 |
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. | 33,308 |
def getNumber(number): if number == 0: res = None elif number < 0: res = number else: res = number - 1 return res | def getNumber(number): if number == 0: res = None elif number < 0: res = number else: res = number - 1 return res | 33,309 |
def listTemplates(self): ''' List all the available templates. | def listTemplates(self): ''' List all the available templates. | 33,310 |
def listTemplates(self): ''' List all the available templates. | def listTemplates(self): ''' List all the available templates. | 33,311 |
def get_translation(language=None, tracker_home=None, translation_class=RoundupTranslations, null_translation_class=RoundupNullTranslations | def get_translation(language=None, tracker_home=None, translation_class=RoundupTranslations, null_translation_class=RoundupNullTranslations | 33,312 |
def get_translation(language=None, tracker_home=None, translation_class=RoundupTranslations, null_translation_class=RoundupNullTranslations | def get_translation(language=None, tracker_home=None, translation_class=RoundupTranslations, null_translation_class=RoundupNullTranslations | 33,313 |
def get_translation(language=None, tracker_home=None, translation_class=RoundupTranslations, null_translation_class=RoundupNullTranslations | def get_translation(language=None, tracker_home=None, translation_class=RoundupTranslations, null_translation_class=RoundupNullTranslations | 33,314 |
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') | 33,315 |
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... | 33,316 |
def usage(message=''): if RoundupService: os_part = \ | def usage(message=''): if RoundupService: os_part = \ | 33,317 |
def usage(message=''): if RoundupService: os_part = \ | def usage(message=''): if RoundupService: os_part = \ | 33,318 |
def usage(message=''): if RoundupService: os_part = \ | def usage(message=''): if RoundupService: os_part = \ | 33,319 |
def usage(message=''): if RoundupService: os_part = \ | def usage(message=''): if RoundupService: os_part = \ | 33,320 |
def run(port=undefined, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) config = ServerConfig() # additional options short_options = "hvS" if RoundupService: short_option... | def run(port=undefined, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) config = ServerConfig() # additional options short_options = "hvS" if RoundupService: short_option... | 33,321 |
def pagefoot(self): if self.debug: self.write('<hr><small><dl>') self.write('<dt><b>Path</b></dt>') self.write('<dd>%s</dd>'%(', '.join(map(repr, self.split_path)))) keys = self.form.keys() keys.sort() if keys: self.write('<dt><b>Form entries</b></dt>') for k in self.form.keys(): v = str(self.form[k].value) self.write(... | def pagefoot(self): if self.debug: self.write('<hr><small><dl>') self.write('<dt><b>Path</b></dt>') self.write('<dd>%s</dd>'%(', '.join(map(repr, self.split_path)))) keys = self.form.keys() keys.sort() if keys: self.write('<dt><b>Form entries</b></dt>') for k in self.form.keys(): v = self.form.getvalue(k, "<empty>") if... | 33,322 |
def pagefoot(self): if self.debug: self.write('<hr><small><dl>') self.write('<dt><b>Path</b></dt>') self.write('<dd>%s</dd>'%(', '.join(map(repr, self.split_path)))) keys = self.form.keys() keys.sort() if keys: self.write('<dt><b>Form entries</b></dt>') for k in self.form.keys(): v = str(self.form[k].value) self.write(... | def pagefoot(self): if self.debug: self.write('<hr><small><dl>') self.write('<dt><b>Path</b></dt>') self.write('<dd>%s</dd>'%(', '.join(map(repr, self.split_path)))) keys = self.form.keys() keys.sort() if keys: self.write('<dt><b>Form entries</b></dt>') for k in self.form.keys(): v = str(self.form[k].value) self.write(... | 33,323 |
def set_cookie(self, user, password): # construct the cookie user = binascii.b2a_base64('%s:%s'%(user, password)).strip() path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'])) self.header({'Set-Cookie': 'roundup_user="%s"; Path="%s";'%(user, path)}) | def set_cookie(self, user, password): # construct the cookie user = binascii.b2a_base64('%s:%s'%(user, password)).strip() path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'])) self.header({'Set-Cookie': 'roundup_user="%s"; Path="%s";'%(user, path)}) | 33,324 |
def classes(self): l = self._client.db.classes.keys() l.sort() return [HTMLClass(self._client, cn) for cn in l] | def def lookupIds(db, prop, ids, num_re=re.compile('-?\d+')): cl = db.getclass(prop.classname) l = [] for entry in ids: if num_re.match(entry): l.append(entry) else: l.append(cl.lookup(entry)) return l classes(self): def lookupIds(db, prop, ids, num_re=re.compile('-?\d+')): cl = db.getclass(prop.classname) l = [] for ... | 33,325 |
def __getitem__(self, item): ''' return an HTMLProperty instance ''' #print 'HTMLClass.getitem', (self, item) | def __getitem__(self, item): ''' return an HTMLProperty instance ''' #print 'HTMLClass.getitem', (self, item) | 33,326 |
def __getitem__(self, item): ''' return an HTMLProperty instance ''' #print 'HTMLClass.getitem', (self, item) | def __getitem__(self, item): ''' return an HTMLProperty instance ''' #print 'HTMLClass.getitem', (self, item) | 33,327 |
def handleListCGIValue(value): ''' Value is either a single item or a list of items. Each item has a .value that we're actually interested in. ''' if isinstance(value, type([])): return [value.value for value in value] else: return value.value.split(',') | def handleListCGIValue(value): ''' Value is either a single item or a list of items. Each item has a .value that we're actually interested in. ''' if isinstance(value, type([])): return [value.value for value in value] else: value = value.value.strip() if not value: return [] return value.split(',') | 33,328 |
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 | 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 | 33,329 |
def __contains__(self, value): ''' Support the "in" operator. We have to make sure the passed-in value is a string first, not a HTMLProperty. ''' print (self, value, self._value) return str(value) in self._value | def __contains__(self, value): ''' Support the "in" operator. We have to make sure the passed-in value is a string first, not a HTMLProperty. ''' return str(value) in self._value | 33,330 |
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 | 33,331 |
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 | 33,332 |
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 | 33,333 |
def inner_main(self): '''Process a request. | def inner_main(self): '''Process a request. | 33,334 |
def getWriteAccess(self): if self.journaltag is not None and self.__RW == 0: #now = time.time #start = now() self._db = None #print "closing the file took %2.2f secs" % (now()-start) #start = now() self._db = metakit.storage(self.dbnm, 1) self.__RW = 1 self.hist = self._db.view('history') self.tables = self._db.view('t... | def getWriteAccess(self): if self.journaltag is not None and self.__RW == 0: #now = time.time #start = now() self._db = None #print "closing the file took %2.2f secs" % (now()-start) #start = now() self._db = metakit.storage(self.dbnm, 1) self.__RW = 1 self.hist = self._db.view('history') self.tables = self._db.view('t... | 33,335 |
def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not propvalues: return if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise DatabaseError, 'Database open read-only' view = self.getview(1) # node must ex... | def set(self, nodeid, **propvalues): isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] if not propvalues: return if propvalues.has_key('id'): raise KeyError, '"id" is reserved' if self.db.journaltag is None: raise DatabaseError, 'Database open read-only' view = self.getview(1) # node must ex... | 33,336 |
def ff(row, r=regexes): for propname, regex in r.items(): val = getattr(row, propname) if not regex.search(val): return 0 return 1 | defff(row,r=regexes):forpropname,regexinr.items():val=getattr(row,propname)ifnotregex.search(val):return0return1 | 33,337 |
def ff(row, r=regexes): for propname, regex in r.items(): val = getattr(row, propname) if not regex.search(val): return 0 return 1 | def ff(row, r=regexes): for propname, regex in r.items(): val = getattr(row, propname) if not regex.search(val): return 0 return 1 | 33,338 |
def bounce_message(self, message, sendto, error, subject='Failed issue tracker submission'): ''' create a message that explains the reason for the failed issue submission to the author and attach the original message. ''' msg = cStringIO.StringIO() writer = MimeWriter.MimeWriter(msg) writer.addheader('Subject', subject... | def bounce_message(self, message, sendto, error, subject='Failed issue tracker submission'): ''' create a message that explains the reason for the failed issue submission to the author and attach the original message. ''' msg = cStringIO.StringIO() writer = MimeWriter.MimeWriter(msg) writer.addheader('Subject', subject... | 33,339 |
def bounce_message(self, message, sendto, error, subject='Failed issue tracker submission'): ''' create a message that explains the reason for the failed issue submission to the author and attach the original message. ''' msg = cStringIO.StringIO() writer = MimeWriter.MimeWriter(msg) writer.addheader('Subject', subject... | def bounce_message(self, message, sendto, error, subject='Failed issue tracker submission'): ''' create a message that explains the reason for the failed issue submission to the author and attach the original message. ''' msg = cStringIO.StringIO() writer = MimeWriter.MimeWriter(msg) writer.addheader('Subject', subject... | 33,340 |
def bounce_message(self, message, sendto, error, subject='Failed issue tracker submission'): ''' create a message that explains the reason for the failed issue submission to the author and attach the original message. ''' msg = cStringIO.StringIO() writer = MimeWriter.MimeWriter(msg) writer.addheader('Subject', subject... | def bounce_message(self, message, sendto, error, subject='Failed issue tracker submission'): ''' create a message that explains the reason for the failed issue submission to the author and attach the original message. ''' msg = cStringIO.StringIO() writer = MimeWriter.MimeWriter(msg) writer.addheader('Subject', subject... | 33,341 |
def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): try: callable(*args, **kwargs) except exception, msg: self.assertEqual(str(msg), message) else: if hasattr(excClass,'__name__'): excName = excClass.__name__ else: excName = str(excClass) raise self.failureException, excName | _nocheck = "don't compare exception values (the exception is enough)" def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): try: callable(*args, **kwargs) except exception, msg: self.assertEqual(str(msg), message) else: if hasattr(excClass,'__name__'): excName = excClass.__name__ else: excName =... | 33,342 |
def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): try: callable(*args, **kwargs) except exception, msg: self.assertEqual(str(msg), message) else: if hasattr(excClass,'__name__'): excName = excClass.__name__ else: excName = str(excClass) raise self.failureException, excName | def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): try: callable(*args, **kwargs) except exception, msg: self.assertEqual(str(msg), message) else: if hasattr(excClass,'__name__'): excName = excClass.__name__ else: excName = str(excClass) raise self.failureException, excName | 33,343 |
def testShowAction(self): self.client.db.config.TRACKER_WEB = 'BASE/' | def testShowAction(self): self.client.db.config.TRACKER_WEB = 'BASE/' | 33,344 |
def field(self, showid=0, size=None): ''' Render a form edit field for the property ''' linkcl = self._db.getclass(self._prop.classname) if linkcl.getprops().has_key('order'): sort_on = 'order' else: sort_on = linkcl.labelprop() options = linkcl.filter(None, {}, ('+', sort_on), (None, None)) # TODO: make this a field d... | def field(self, showid=0, size=None): ''' Render a form edit field for the property ''' linkcl = self._db.getclass(self._prop.classname) if linkcl.getprops().has_key('order'): sort_on = 'order' else: sort_on = linkcl.labelprop() options = linkcl.filter(None, {}, ('+', sort_on), (None, None)) # TODO: make this a field d... | 33,345 |
def menu(self, size=None, height=None, showid=0, additional=[], **conditions): ''' Render a form select list for this property ''' value = self._value | def menu(self, size=None, height=None, showid=0, additional=[], **conditions): ''' Render a form select list for this property ''' value = self._value | 33,346 |
def menu(self, size=None, height=None, showid=0, additional=[], **conditions): ''' Render a form select list for this property ''' value = self._value | def menu(self, size=None, height=None, showid=0, additional=[], **conditions): ''' Render a form select list for this property ''' value = self._value | 33,347 |
def __str__(self): d = {} d.update(self.__dict__) f = '' for k in self.form.keys(): f += '\n %r=%r'%(k,handleListCGIValue(self.form[k])) d['form'] = f e = '' for k,v in self.env.items(): e += '\n %r=%r'%(k, v) d['env'] = e return ''' | def __str__(self): d = {} d.update(self.__dict__) f = '' for k in self.form.keys(): f += '\n %r=%r'%(k,handleListCGIValue(self.form[k])) d['form'] = f e = '' for k,v in self.env.items(): e += '\n %r=%r'%(k, v) d['env'] = e return ''' | 33,348 |
def __init__(self, db, classname, **properties): """Create a new class with a given name and property specification. | def __init__(self, db, classname, **properties): """Create a new class with a given name and property specification. | 33,349 |
def orderprop (self): """Return the property name to use for sorting for the given node. | def orderprop (self): """Return the property name to use for sorting for the given node. | 33,350 |
def index(self, nodeid): '''Add (or refresh) the node to search indexes ''' raise NotImplementedError | def index(self, nodeid): '''Add (or refresh) the node to search indexes ''' raise NotImplementedError | 33,351 |
def export_propnames(self): '''List the property names for export from this Class.''' propnames = self.getprops().keys() propnames.sort() return propnames | def export_propnames(self): """List the property names for export from this Class""" propnames = self.getprops().keys() propnames.sort() return propnames | 33,352 |
def export_files(self, dirname, nodeid): ''' Export the "content" property as a file, not csv column ''' source = self.db.filename(self.classname, nodeid) | def export_files(self, dirname, nodeid): ''' Export the "content" property as a file, not csv column ''' source = self.db.filename(self.classname, nodeid) | 33,353 |
def __init__(self, tracker_home, optimize=0): """New-style tracker instance constructor | def __init__(self, tracker_home, optimize=0): """New-style tracker instance constructor | 33,354 |
def get_extensions(self, dirname): """Load python extensions | def get_extensions(self, dirname): """Load python extensions | 33,355 |
def history(self): if not self.is_view_ok(): return _('[hidden]') return self._('New node - no history') | def history(self): if not self.is_view_ok(): return self._('[hidden]') return self._('New node - no history') | 33,356 |
def history(self, direction='descending', dre=re.compile('^\d+$')): if not self.is_view_ok(): return _('[hidden]') | def history(self, direction='descending', dre=re.compile('^\d+$')): if not self.is_view_ok(): return _('[hidden]') | 33,357 |
def plain(self, escape=0, hyperlink=0): '''Render a "plain" representation of the property | def plain(self, escape=0, hyperlink=0): '''Render a "plain" representation of the property | 33,358 |
def stext(self, escape=0): ''' Render the value of the property as StructuredText. | def stext(self, escape=0): ''' Render the value of the property as StructuredText. | 33,359 |
def email(self, escape=1): ''' Render the value of the property as an obscured email address ''' if not self.is_view_ok(): return _('[hidden]') | def email(self, escape=1): ''' Render the value of the property as an obscured email address ''' if not self.is_view_ok(): return _('[hidden]') | 33,360 |
def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | 33,361 |
def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | 33,362 |
def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | 33,363 |
def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | 33,364 |
def now(self, str_interval=None): ''' Return the current time. | def now(self, str_interval=None): ''' Return the current time. | 33,365 |
def field(self, size=30, default=None, format=_marker): '''Render a form edit field for the property | def field(self, size=30, default=None, format=_marker): '''Render a form edit field for the property | 33,366 |
def reldate(self, pretty=1): ''' Render the interval between the date and now. | def reldate(self, pretty=1): ''' Render the interval between the date and now. | 33,367 |
def pretty(self, format=_marker): ''' Render the date in a pretty format (eg. month names, spaces). | def pretty(self, format=_marker): ''' Render the date in a pretty format (eg. month names, spaces). | 33,368 |
def local(self, offset): ''' Return the date/time as a local (timezone offset) date/time. ''' if not self.is_view_ok(): return _('[hidden]') | def local(self, offset): ''' Return the date/time as a local (timezone offset) date/time. ''' if not self.is_view_ok(): return _('[hidden]') | 33,369 |
def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | 33,370 |
def pretty(self): ''' Render the interval in a pretty format (eg. "yesterday") ''' if not self.is_view_ok(): return _('[hidden]') | def pretty(self): ''' Render the interval in a pretty format (eg. "yesterday") ''' if not self.is_view_ok(): return _('[hidden]') | 33,371 |
def __getattr__(self, attr): ''' return a new HTMLItem ''' #print 'Link.getattr', (self, attr, self._value) if not self._value: raise AttributeError, "Can't access missing value" i = HTMLItem(self._client, self._prop.classname, self._value) return getattr(i, attr) | def __getattr__(self, attr): ''' return a new HTMLItem ''' #print 'Link.getattr', (self, attr, self._value) if not self._value: msg = self._('Attempt to look up %(attr)s on a missing value') return MissingValue(msg%locals()) i = HTMLItem(self._client, self._prop.classname, self._value) return getattr(i, attr) | 33,372 |
def plain(self, escape=0): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | def plain(self, escape=0): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | 33,373 |
def plain(self, escape=0): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | def plain(self, escape=0): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') | 33,374 |
def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. | def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. | 33,375 |
def getnode(self, classname, nodeid): ''' Get a node from the database. ''' if __debug__: print >>hyperdb.DEBUG, 'getnode', (self, classname, nodeid) | def getnode(self, classname, nodeid): ''' Get a node from the database. ''' if __debug__: print >>hyperdb.DEBUG, 'getnode', (self, classname, nodeid) | 33,376 |
def getnode(self, classname, nodeid): ''' Get a node from the database. ''' if __debug__: print >>hyperdb.DEBUG, 'getnode', (self, classname, nodeid) | def getnode(self, classname, nodeid): ''' Get a node from the database. ''' if __debug__: print >>hyperdb.DEBUG, 'getnode', (self, classname, nodeid) | 33,377 |
def _serve_file(self, lmt, mime_type, content): ''' guts of serve_file() and serve_static_file() ''' # spit out headers self.additional_headers['Content-Type'] = mime_type self.additional_headers['Content-Length'] = str(len(content)) lmt = rfc822.formatdate(lmt) self.additional_headers['Last-Modified'] = lmt | def _serve_file(self, lmt, mime_type, content): ''' guts of serve_file() and serve_static_file() ''' # spit out headers self.additional_headers['Content-Type'] = mime_type self.additional_headers['Content-Length'] = str(len(content)) lmt = rfc822.formatdate(lmt) self.additional_headers['Last-Modified'] = lmt | 33,378 |
def _serve_file(self, lmt, mime_type, content): ''' guts of serve_file() and serve_static_file() ''' # spit out headers self.additional_headers['Content-Type'] = mime_type self.additional_headers['Content-Length'] = str(len(content)) lmt = rfc822.formatdate(lmt) self.additional_headers['Last-Modified'] = lmt | def _serve_file(self, lmt, mime_type, content): ''' guts of serve_file() and serve_static_file() ''' # spit out headers self.additional_headers['Content-Type'] = mime_type self.additional_headers['Content-Length'] = str(len(content)) lmt = rfc822.formatdate(lmt) self.additional_headers['Last-Modified'] = lmt | 33,379 |
def permission(self): """Check whether the user has permission to execute this action. | def permission(self): """Check whether the user has permission to execute this action. | 33,380 |
def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, 'No type specifi... | def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, self._('No type ... | 33,381 |
def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, 'No type specifi... | def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, 'No type specifi... | 33,382 |
def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, 'No type specifi... | def handle(self, typere=re.compile('[@:]type'), numre=re.compile('[@:]number')): """Show a node of a particular class/id.""" t = n = '' for key in self.form.keys(): if typere.match(key): t = self.form[key].value.strip() elif numre.match(key): n = self.form[key].value.strip() if not t: raise ValueError, 'No type specifi... | 33,383 |
def handle(self): """Retire the context item.""" # if we want to view the index template now, then unset the nodeid # context info (a special-case for retire actions on the index page) nodeid = self.nodeid if self.template == 'index': self.client.nodeid = None | def handle(self): """Retire the context item.""" # if we want to view the index template now, then unset the nodeid # context info (a special-case for retire actions on the index page) nodeid = self.nodeid if self.template == 'index': self.client.nodeid = None | 33,384 |
def handle(self): """Retire the context item.""" # if we want to view the index template now, then unset the nodeid # context info (a special-case for retire actions on the index page) nodeid = self.nodeid if self.template == 'index': self.client.nodeid = None | def handle(self): """Retire the context item.""" # if we want to view the index template now, then unset the nodeid # context info (a special-case for retire actions on the index page) nodeid = self.nodeid if self.template == 'index': self.client.nodeid = None | 33,385 |
def handle(self): """Performs an edit of all of a class' items in one go. | def handle(self): """Performs an edit of all of a class' items in one go. | 33,386 |
def handle(self): """Performs an edit of all of a class' items in one go. | def handle(self): """Performs an edit of all of a class' items in one go. | 33,387 |
def handle(self): """Performs an edit of all of a class' items in one go. | def handle(self): """Performs an edit of all of a class' items in one go. | 33,388 |
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. | 33,389 |
def handle(self): """Perform an edit of an item in the database. | def handle(self): """Perform an edit of an item in the database. | 33,390 |
def handle(self): ''' Add a new item to the database. | def handle(self): ''' Add a new item to the database. | 33,391 |
def handle(self): ''' Add a new item to the database. | def handle(self): ''' Add a new item to the database. | 33,392 |
def handle(self): """Grab the OTK, use it to load up the new user details.""" try: # pull the rego information out of the otk database self.userid = self.db.confirm_registration(self.form['otk'].value) except (ValueError, KeyError), message: self.client.error_message.append(str(message)) return | def handle(self): """Grab the OTK, use it to load up the new user details.""" try: # pull the rego information out of the otk database self.userid = self.db.confirm_registration(self.form['otk'].value) except (ValueError, KeyError), message: self.client.error_message.append(str(message)) return | 33,393 |
def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. | def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. | 33,394 |
def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. | def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. | 33,395 |
def handle(self): """Make us really anonymous - nuke the cookie too.""" # log us out self.client.make_user_anonymous() | def handle(self): """Make us really anonymous - nuke the cookie too.""" # log us out self.client.make_user_anonymous() | 33,396 |
def handle(self): """Attempt to log a user in. | def handle(self): """Attempt to log a user in. | 33,397 |
def handle(self): """Attempt to log a user in. | def handle(self): """Attempt to log a user in. | 33,398 |
def handle(self): """Attempt to log a user in. | def handle(self): """Attempt to log a user in. | 33,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.