rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
print 'list' | def list(self, sort=None, group=None, filter=None, columns=None, filterspec=None, show_customization=None, show_nodes=1, pagesize=None): ''' call the template index with the args | |
print `props` | def _createnode(self): ''' create a node based on the contents of the form ''' cl = self.db.classes[self.classname] props = parsePropsFromForm(self.db, cl, self.form) | |
def _createnode(self): ''' create a node based on the contents of the form ''' cl = self.db.classes[self.classname] props, dummy = parsePropsFromForm(self.db, cl, self.form) if not props.has_key('status'): try: unread_id = self.db.status.lookup('unread') except KeyError: pass else: props['status'] = unread_id if pr... | def showfile(self): ''' display a file ''' nodeid = self.nodeid cl = self.db.file mime_type = cl.get(nodeid, 'type') if mime_type == 'message/rfc822': mime_type = 'text/plain' self.header(headers={'Content-Type': mime_type}) self.write(cl.get(nodeid, 'content')) | |
if hasattr(backends, 'mysql'): l.append(unittest.makeSuite(mysqlDBTestCase, 'test')) l.append(unittest.makeSuite(mysqlReadOnlyDBTestCase, 'test')) | p = [] | def suite(): l = [ unittest.makeSuite(anydbmDBTestCase, 'test'), unittest.makeSuite(anydbmReadOnlyDBTestCase, 'test') ] |
value = str(value) | if type(value) != type(''): raise ValueError, 'link value must be String' | def create(self, **propvalues): """Create a new node of this class and return its id. |
raise ValueError, 'new property "%s": %s not a %s'%( | raise IndexError, 'new property "%s": %s not a %s'%( | def create(self, **propvalues): """Create a new node of this class and return its id. |
raise ValueError, '%s has no node %s'%(link_class, value) | raise IndexError, '%s has no node %s'%(link_class, value) | def create(self, **propvalues): """Create a new node of this class and return its id. |
for entry in map(str, value): | for entry in value: if type(entry) != type(''): raise ValueError, 'link value must be String' | def create(self, **propvalues): """Create a new node of this class and return its id. |
raise ValueError, '%s has no node %s'%(link_class, id) | raise IndexError, '%s has no node %s'%(link_class, id) | def create(self, **propvalues): """Create a new node of this class and return its id. |
for key,prop in self.properties.items(): if propvalues.has_key(str(key)): | for key, prop in self.properties.items(): if propvalues.has_key(key): | def create(self, **propvalues): """Create a new node of this class and return its id. |
d = self.db.getnode(self.classname, str(nodeid)) | d = self.db.getnode(self.classname, nodeid) | def get(self, nodeid, propname): """Get the value of a property on an existing node of this class. |
nodeid = str(nodeid) | 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. | |
value = str(value) | 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. | |
raise ValueError, 'new property "%s": %s not a %s'%( | raise IndexError, 'new property "%s": %s not a %s'%( | 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. |
raise ValueError, '%s has no node %s'%(link_class, value) | raise IndexError, '%s has no node %s'%(link_class, value) | 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. |
for entry in map(str, value): | for entry in value: if type(entry) != type(''): raise ValueError, 'link value must be String' | 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. |
raise ValueError, '%s has no node %s'%(link_class, id) | raise IndexError, '%s has no node %s'%(link_class, id) | 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. |
nodeid = str(nodeid) | 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. """ nodeid = str(nodeid) if self.db... | |
nodeid = str(nodeid) | def find(self, **propspec): """Get the ids of nodes in this class which link to a given node. | |
if msgid: | if msgid is not None: | def good_recipient(userid): # Make sure we don't send mail to either the anonymous # user or a user who has already seen the message. return (userid and (self.db.user.get(userid, 'username') != 'anonymous') and not seen_message.has_key(userid)) |
message_files = msgid and messages.get(msgid, 'files') or None | if msgid is None: message_files = None else: message_files = messages.get(msgid, 'files') | def send_message(self, nodeid, msgid, note, sendto, from_address=None, bcc_sendto=[]): '''Actually send the nominated message from this node to the sendto recipients, with the note appended. ''' users = self.db.user messages = self.db.msg files = self.db.file |
errors = '\n- '.join(errors) | errors = '\n- '.join(map(str, errors)) | def handle_message(self, message): ''' message - a Message instance |
return '<a href="%s">%s%s</a>'%(s, s1, s2) | return '<a href="%s%s">%s</a>'%(s1, s2, s) | def _hyper_repl(self, match): if match.group('url'): s = match.group('url') return '<a href="%s">%s</a>'%(s, s) elif match.group('email'): s = match.group('email') return '<a href="mailto:%s">%s</a>'%(s, s) else: s = match.group('item') s1 = match.group('class').lower() s2 = match.group('id') try: # make sure s1 is a v... |
return '%s%s'%(s1, s2) | return s | def _hyper_repl(self, match): if match.group('url'): s = match.group('url') return '<a href="%s">%s</a>'%(s, s) elif match.group('email'): s = match.group('email') return '<a href="mailto:%s">%s</a>'%(s, s) else: s = match.group('item') s1 = match.group('class').lower() s2 = match.group('id') try: # make sure s1 is a v... |
s = ','.join([a for x in v]) where.append('(_%s in (%s)%s)'%(k, s, xtra)) args = args + v | if v: s = ','.join([a for x in v]) where.append('(_%s in (%s)%s)'%(k, s, xtra)) args = args + v else: where.append('_%s is NULL'%k) | 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 |
self.dispname = None | def _post_init(self): ''' Set attributes based on self.form ''' # extract the index display information from the form self.columns = [] for name in ':columns @columns'.split(): if self.form.has_key(name): self.special_char = name[0] self.columns = handleListCGIValue(self.form[name]) break self.show = support.TruthDict(... | |
value = self.form['@dispname'].value self.dispname = value.decode(self.client.charset) | self.dispname = self.form['@dispname'].value else: self.dispname = None | def _post_init(self): ''' Set attributes based on self.form ''' # extract the index display information from the form self.columns = [] for name in ':columns @columns'.split(): if self.form.has_key(name): self.special_char = name[0] self.columns = handleListCGIValue(self.form[name]) break self.show = support.TruthDict(... |
raise Unauthorised, self._('You do not have permission to ' | raise exceptions.Unauthorised, self._( 'You do not have permission to ' | def permission(self): """Check whether the user has permission to execute this action. |
raise SeriousError, self._('No ID entered') | raise exceptions.SeriousError, self._('No ID entered') | 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 ... |
raise SeriousError, self._( | raise exceptions.SeriousError, self._( | 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 ... |
raise Redirect, url | raise exceptions.Redirect, url | 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 ... |
raise Unauthorised, self._( | raise exceptions.Unauthorised, self._( | 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 Unauthorised, self._( 'You do not have permission to edit %(class)s' ) % {'class': cn} |
raise Unauthorised, self._( | raise exceptions.Unauthorised, self._( | def _createnode(self, cn, props): """Create a node based on the contents of the form.""" # check for permission if not self.newItemPermission(props): raise Unauthorised, self._( 'You do not have permission to create %(class)s' ) % {'class': cn} |
raise Unauthorised, self._( | raise exceptions.Unauthorised, self._( | def editItemPermission(self, props): """Determine whether the user has permission to edit this item. |
raise Redirect, url | raise exceptions.Redirect, url | def handle(self): """Perform an edit of an item in the database. |
raise Redirect, '%s%s%s?@ok_message=%s&@template=%s'%(self.base, self.classname, self.nodeid, urllib.quote(messages), | raise exceptions.Redirect, '%s%s%s?@ok_message=%s&@template=%s' % ( self.base, self.classname, self.nodeid, urllib.quote(messages), | def handle(self): ''' Add a new item to the database. |
raise Unauthorised, self._( | raise exceptions.Unauthorised, self._( | def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. |
raise Redirect, '%suser?@template=rego_progress'%self.base | raise exceptions.Redirect, '%suser?@template=rego_progress'%self.base | def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. |
self.client.userid = self.db.user.lookup(self.client.user) | self.client.userid = self.db.user.lookup(username) | def handle(self): """Attempt to log a user in. |
name = self.client.user self.client.error_message.append(self._('Ivalid login')) self.client.make_user_anonymous() return | raise exceptions.LoginError, self._('Invalid login') | def handle(self): """Attempt to log a user in. |
self.client.make_user_anonymous() self.client.error_message.append(self._('Invalid login')) return | raise exceptions.LoginError, self._('Invalid login') | def handle(self): """Attempt to log a user in. |
self.client.make_user_anonymous() self.client.error_message.append( self._("You do not have permission to login")) return self.client.opendb(self.client.user) self.client.set_cookie(self.client.user) | raise exceptions.LoginError, self._( "You do not have permission to login") | def handle(self): """Attempt to log a user in. |
for name in os.listdir(dirname): if not name.endswith('.py'): continue vars = {} self._load_python(os.path.join(dirname, name), vars) vars['init'](parent) | if os.path.isdir(dirname): for name in os.listdir(dirname): if not name.endswith('.py'): continue vars = {} self._load_python(os.path.join(dirname, name), vars) vars['init'](parent) | def load_extensions(self, parent, dirname): dirname = os.path.join(self.tracker_home, dirname) for name in os.listdir(dirname): if not name.endswith('.py'): continue vars = {} self._load_python(os.path.join(dirname, name), vars) vars['init'](parent) |
def __init__(self, spec='.', offset=0, add_granularity=0): | def __init__(self, spec='.', offset=0, add_granularity=0, translator=i18n): | def __init__(self, spec='.', offset=0, add_granularity=0): """Construct a date given a specification and a time zone offset. |
raise ValueError, _('Not a date spec: %s' % self.usagespec) | raise ValueError, self._('Not a date spec: %s') % self.usagespec | def set(self, spec, offset=0, date_re=re.compile(r''' ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd (?P<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss (?P<o>.+)? ... |
raise ValueError, _('%r not a date spec (%s)')%(spec, | raise ValueError, self._('%r not a date spec (%s)')%(spec, | def set(self, spec, offset=0, date_re=re.compile(r''' ((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]] |(?P<a>\d\d?)[/-](?P<b>\d\d?))? # or mm-dd (?P<n>\.)? # . (((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d(\.\d+)?))?)? # hh:mm:ss (?P<o>.+)? ... |
def __init__(self, spec, sign=1, allowdate=1, add_granularity=0): | def __init__(self, spec, sign=1, allowdate=1, add_granularity=0, translator=i18n ): | def __init__(self, spec, sign=1, allowdate=1, add_granularity=0): """Construct an interval given a specification.""" if type(spec) in (IntType, FloatType, LongType): self.from_seconds(spec) elif type(spec) in (StringType, UnicodeType): self.set(spec, allowdate=allowdate, add_granularity=add_granularity) else: if len(sp... |
raise ValueError, _('Not an interval spec: [+-] [ '[ | raise ValueError, self._('Not an interval spec:' ' [+-] [ | def set(self, spec, allowdate=1, interval_re=re.compile(''' \s*(?P<s>[-+])? # + or - \s*((?P<y>\d+\s*)y)? # year \s*((?P<m>\d+\s*)m)? # month \s*((?P<w>\d+\s*)w)? # week \s*((?P<d>\d+\s*)d)? # day \s*(((?P<H>\d+):(?P<M>\d+))?(:(?P<S>\d+))?)? # time \s*(?P<D> (\d\d\d\d[/-])?(\d\d?)?[/-](\d\d?)? ... |
if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'number': int(days/30)} else: s = _('1 month') else: s = _('%(number)s weeks')%{'number': int(days... | s = self.ngettext("%(number)s year", "%(number)s years", self.year) % {'number': self.year} elif self.month or self.day > 28: _months = int(((self.month * 30) + self.day) / 30) s = self.ngettext("%(number)s month", "%(number)s months", _months) % {'number': _months} | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
s = _('1 week') | _weeks = int(self.day / 7) s = self.ngettext("%(number)s week", "%(number)s weeks", _weeks) % {'number': _weeks} | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
s = _('%(number)s days')%{'number': self.day} | s = self.ngettext('%(number)s day', '%(number)s days', self.day) % {'number': self.day} | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
return _('tomorrow') | return self._('tomorrow') | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
return _('yesterday') | return self._('yesterday') | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
s = _('%(number)s hours')%{'number': self.hour} | s = self.ngettext('%(number)s hour', '%(number)s hours', self.hour) % {'number': self.hour} | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
s = _('an hour') elif self.minute/15 == 2: s = _('1 1/2 hours') | s = self._('an hour') elif _quarters == 2: s = self._('1 1/2 hours') | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
s = _('1 %(number)s/4 hours')%{'number': self.minute/15} | s = self.ngettext('1 %(number)s/4 hours', '1 %(number)s/4 hours', _quarters) % {'number': _quarters} | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
return _('in a moment') | return self._('in a moment') | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
return _('just now') | return self._('just now') | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
s = _('1 minute') | s = self._('1 minute') | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
s = _('%(number)s minutes')%{'number': self.minute} elif int(self.minute/15) == 2: s = _('1/2 an hour') else: s = _('%(number)s/4 hour')%{'number': int(self.minute/15)} if self.sign < 0: s = s + _(' ago') else: s = _('in ') + s | s = self.ngettext('%(number)s minute', '%(number)s minutes', self.minute) % {'number': self.minute} elif _quarters == 2: s = self._('1/2 an hour') else: s = self.ngettext('%(number)s/4 hours', '%(number)s/4 hours', _quarters) % {'number': _quarters} if self.sign < 0: s = self._('%s ago') % s else: s = self._('in %s') ... | def pretty(self): ''' print up the date date using one of these nice formats.. ''' if self.year: if self.year == 1: s = _('1 year') else: s = _('%(number)s years')%{'number': self.year} elif self.month or self.day > 13: days = (self.month * 30) + self.day if days > 28: if int(days/30) > 1: s = _('%(number)s months')%{'... |
return '%s weeks'%self.day | return '1 week' | def pretty(self, threshold=('d', 5)): ''' print up the date date using one of these nice formats.. < 1 minute < 15 minutes < 30 minutes < 1 hour < 12 hours < 1 day otherwise, return None (so a full date may be displayed) ''' if self.year or self.month > 2: return None if self.month: days = (self.month * 30) + self.day ... |
value = self.cl.get(self.nodeid, property) | if isinstance(propclass, hyperdb.Link: value = [self.cl.get(self.nodeid, property)] else: value = self.cl.get(self.nodeid, property) | def __call__(self, property, **args): propclass = self.properties[property] if self.nodeid: value = self.cl.get(self.nodeid, property) elif self.filterspec is not None: value = self.filterspec.get(property, []) else: value = [] if (isinstance(propclass, hyperdb.Link) or isinstance(propclass, hyperdb.Multilink)): linkcl... |
if (isinstance(propclass, hyperdb.Link) or isinstance(propclass, hyperdb.Multilink)): linkcl = self.db.classes[propclass.classname] l = [] k = linkcl.labelprop() for optionid in linkcl.list(): option = linkcl.get(optionid, k) if optionid in value or option in value: checked = 'checked' else: checked = '' l.append('%s:<... | linkcl = self.db.classes[propclass.classname] l = [] k = linkcl.labelprop() for optionid in linkcl.list(): option = linkcl.get(optionid, k) if optionid in value or option in value: checked = 'checked' else: checked = '' l.append('%s:<input type="checkbox" %s name="%s" value="%s">'%( option, checked, property, option)) ... | def __call__(self, property, **args): propclass = self.properties[property] if self.nodeid: value = self.cl.get(self.nodeid, property) elif self.filterspec is not None: value = self.filterspec.get(property, []) else: value = [] if (isinstance(propclass, hyperdb.Link) or isinstance(propclass, hyperdb.Multilink)): linkcl... |
(nodeid, date_stamp, self.journaltag, action, params) = entry | (nodeid, date_stamp, user, action, params) = entry | def getjournal(self, classname, nodeid): ''' get the journal for id ''' # attempt to open the journal - in some rare cases, the journal may # not exist try: db = bsddb.btopen(os.path.join(self.dir, 'journals.%s'%classname), 'r') except bsddb.error, error: if error.args[0] != 2: raise return [] # mor handling of bad jou... |
res.append((nodeid, date_obj, self.journaltag, action, params)) | res.append((nodeid, date_obj, user, action, params)) | def getjournal(self, classname, nodeid): ''' get the journal for id ''' # attempt to open the journal - in some rare cases, the journal may # not exist try: db = bsddb.btopen(os.path.join(self.dir, 'journals.%s'%classname), 'r') except bsddb.error, error: if error.args[0] != 2: raise return [] # mor handling of bad jou... |
sortfunc = self.make_sort_function(propclass.classname) | def do_field(self, property, size=None, showid=0): ''' display a property like the plain displayer, but in a text field to be edited | |
options = linkcl.list() options.sort(sortfunc) | if linkcl.getprops().has_key('order'): sort_on = 'order' else: sort_on = linkcl.labelprop() options = linkcl.filter(None, {}, [sort_on], []) | def do_field(self, property, size=None, showid=0): ''' display a property like the plain displayer, but in a text field to be edited |
options = linkcl.list() options.sort(sortfunc) | if linkcl.getprops().has_key('order'): sort_on = 'order' else: sort_on = linkcl.labelprop() options = linkcl.filter(None, {}, [sort_on], []) | def do_menu(self, property, size=None, height=None, showid=0, additional=[]): ''' For a Link/Multilink property, display a menu of the available choices |
journaldate = str(date.Date(journaldate)) | journaldate = date.Date(journaldate) | def add_new_columns_v2(self): '''While we're adding the actor column, we need to update the tables to have the correct datatypes.''' for klass in self.classes.values(): cn = klass.classname properties = klass.getprops() old_spec = self.database_schema['tables'][cn] |
self.save_journal(cn, cols, nodeid, journaldate, | self.save_journal(cn, cols, nodeid, dc(journaldate), | def add_new_columns_v2(self): '''While we're adding the actor column, we need to update the tables to have the correct datatypes.''' for klass in self.classes.values(): cn = klass.classname properties = klass.getprops() old_spec = self.database_schema['tables'][cn] |
def pt_html(context=5): | def pt_html(context=5, i18n=None): _ = get_translator(i18n) | 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... |
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>', | exc_info = [esc(str(value)) for value in sys.exc_info()[:2]] l = [_('<h1>Templating Error</h1>\n' '<p><b>%(exc_type)s</b>: %(exc_value)s</p>\n' '<p class="help">Debugging information follows</p>' ) % {'exc_type': exc_info[0], 'exc_value': exc_info[1]}, | 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... |
s.append('<li>"%s" (%s)</li>'%(name, esc(repr(info)))) | s.append(_('<li>"%(name)s" (%(info)s)</li>') % {'name': name, 'info': esc(repr(info))}) | 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... |
l.append('<li>Looking for "%s", current path:<ol>%s</ol></li>'%( ti.name, s)) | l.append(_('<li>Looking for "%(name)s", ' 'current path:<ol>%(path)s</ol></li>' ) % {'name': ti.name, 'path': s}) | 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... |
l.append('<li>In %s</li>'%esc(str(ti))) | l.append(_('<li>In %s</li>') % esc(str(ti))) | 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... |
s = 'A problem occurred in your template "%s".'%str(context.id) | s = _('A problem occurred in your template "%s".') \ % str(context.id) | 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... |
l.append(''' <li>While evaluating the %r expression on line %d | l.append(_(''' <li>While evaluating the %(info)r expression on line %(line)d | 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... |
%s %s | %(globals)s %(locals)s | 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... |
'''%(info, context.position[0], niceDict(' ', context.global_vars), niceDict(' ', context.local_vars))) | ''') % { 'info': info, 'line': context.position[0], 'globals': niceDict(' ', context.global_vars), 'locals': niceDict(' ', context.local_vars) }) | 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... |
<tr><th class="header" align="left">Full traceback:</th></tr> | <tr><th class="header" align="left">%s</th></tr> | 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... |
</table>'''%cgi.escape(''.join(traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)))) | </table>''' % (_('Full traceback:'), cgi.escape(''.join( traceback.format_exception(*sys.exc_info()) )))) | 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 html(context=5): | def html(context=5, i18n=None): _ = get_translator(i18n) | 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... |
'<font size=+1><strong>%s</strong>: %s</font>'%(etype, evalue), | _('<font size=+1><strong>%(exc_type)s</strong>: %(exc_value)s</font>') % {'exc_type': etype, 'exc_value': evalue}, | 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... |
link = '''<file is None - probably inside <tt>eval</tt> or <tt>exec</tt>>''' | link = _("<file is None - probably inside <tt>eval</tt> " "or <tt>exec</tt>>") | 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... |
call = 'in <strong>%s</strong>' % func + inspect.formatargvalues( | call = _('in <strong>%s</strong>') % func + inspect.formatargvalues( | 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... |
if not os.getuid(): | if os.getuid(): | 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... |
v = int(value) | v = float(value) | def set_inner(self, nodeid, **propvalues): '''Called outside of auditors''' isnew = 0 if propvalues.has_key('#ISNEW'): isnew = 1 del propvalues['#ISNEW'] |
where[propname] = int(value) | if type(value) is _LISTTYPE: orcriteria[propname] = [float(v) for v in value] else: where[propname] = float(value) | 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 |
value = int(value) | value = float(value) | 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. |
hyperdb.Number : 'I', | hyperdb.Number : 'D', | def getNumber(number): if number == 0: res = None elif number < 0: res = number else: res = number - 1 return res |
path = __file__ for i in range(5): path = os.path.dirname(path) tdir = os.path.join(path, 'share', 'roundup', 'templates') if os.path.isdir(tdir): templates = listTemplates(tdir) else: templates = {} | templates = {} for N in 4, 5: path = __file__ for i in range(N): path = os.path.dirname(path) tdir = os.path.join(path, 'share', 'roundup', 'templates') if os.path.isdir(tdir): templates = listTemplates(tdir) break | def listTemplates(self): ''' List all the available templates. |
if tracker_home is not None: | if tracker_home is None: tracker_locale = None else: | def get_translation(language=None, tracker_home=None, translation_class=RoundupTranslations, null_translation_class=RoundupNullTranslations |
else: tracker_locale = None | def get_translation(language=None, tracker_home=None, translation_class=RoundupTranslations, null_translation_class=RoundupNullTranslations | |
for mofile in mofiles: | for mofile in mofiles[1:]: | def get_translation(language=None, tracker_home=None, translation_class=RoundupTranslations, null_translation_class=RoundupNullTranslations |
user = 'anonymous' | def determine_user(self): ''' Determine who the user is ''' # determine the uid to use self.opendb('admin') | |
_svc_name_ = "Roundup Bug Tracker" | _svc_name_ = "roundup" | 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... |
must configure the rest of the options by changing the constants of this program. You will at least configure one tracker in the TRACKER_HOMES variable. This option is mutually exclusive from the rest. Typing "roundup-server -c help" shows Windows Services | must use configuration file to specify tracker homes. Logfile option is required to run Roundup Tracker service. Typing "roundup-server -c help" shows Windows Services | def usage(message=''): if RoundupService: os_part = \ |
-v prints the Roundup version number and exits -C <fname> use configuration file -n <name> sets the host name of the Roundup web server instance -p <port> sets the port to listen on (default: %(port)s) | -v print the Roundup version number and exit -h print this text and exit -S create or update configuration file and exit -C <fname> use configuration file <fname> -n <name> set the host name of the Roundup web server instance -p <port> set the port to listen on (default: %(po... | def usage(message=''): if RoundupService: os_part = \ |
See the "admin_guide" in the Roundup "doc" directory. | Roundup Server configuration file has common .ini file format. Configuration file created with 'roundup-server -S' contains detailed explanations for each option. Please see that file for option descriptions. | def usage(message=''): if RoundupService: os_part = \ |
short_options = "c:C:" | short_options = "cC:" | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.