rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
v = str(self.form[k].value) self.write('<dd><em>%s</em>:%s</dd>'%(k, cgi.escape(v))) | v = self.form.getvalue(k, "<empty>") if type(v) is type([]): v = "|".join(v) self.write('<dd><em>%s</em>=%s</dd>'%(k, cgi.escape(v))) keys = self.headers_sent.keys() keys.sort() self.write('<dt><b>Sent these HTTP headers</b></dt>') for k in keys: v = self.headers_sent[k] self.write('<dd><em>%s</em>=%s</dd>'%(k, cgi.es... | 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(... |
self.write('<dd><em>%s</em>:%s</dd>'%(k, cgi.escape(v))) | self.write('<dd><em>%s</em>=%s</dd>'%(k, cgi.escape(v))) | 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(... |
self.header({'Set-Cookie': 'roundup_user="%s"; Path="%s";'%(user, path)}) | self.header({'Set-Cookie': 'roundup_user="%s"; expires="%s"; Path="%s";' % ( user, expire, 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)}) |
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 | def classes(self): l = self._client.db.classes.keys() l.sort() return [HTMLClass(self._client, cn) for cn in l] | |
if isinstance(prop, hyperdb.Multilink): value = [] | if not isinstance(prop, klass): continue if form.has_key(item): if isinstance(prop, hyperdb.Multilink): value = lookupIds(self._db, prop, handleListCGIValue(form[item])) elif isinstance(prop, hyperdb.Link): value = form[item].value.strip() if value: value = lookupIds(self._db, prop, [value])[0] else: value = None else:... | def __getitem__(self, item): ''' return an HTMLProperty instance ''' #print 'HTMLClass.getitem', (self, item) |
value = None if isinstance(prop, klass): return htmlklass(self._client, '', prop, item, value) | if isinstance(prop, hyperdb.Multilink): value = [] else: value = None print (prop, value) return htmlklass(self._client, '', prop, item, value) | def __getitem__(self, item): ''' return an HTMLProperty instance ''' #print 'HTMLClass.getitem', (self, item) |
return value.value.split(',') | value = value.value.strip() if not value: return [] return 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: return value.value.split(',') |
3. Re-start the server by running "python demo.py" again. 4. Re-initialise the server by running "python demo.py nuke". | 3. Re-start the server by running "roundup-demo" again. 4. Re-initialise the server by running "roundup-demo nuke". | 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 |
print (self, value, 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. ''' print (self, value, self._value) return str(value) in self._value | |
(direction, property) where direction is '+' or '-'. | (direction, property) where direction is '+' or '-'. A single string with the direction prepended may be used. For example: ('-', 'order'), '+name'. | def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form select list for this property |
if linkcl.getprops().has_key('order'): | if sort_on is not None: if not isinstance(sort_on, tuple): if sort_on[0] in '+-': sort_on = (sort_on[0], sort_on[1:]) else: sort_on = ('+', sort_on) elif linkcl.getprops().has_key('order'): | def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form select list for this property |
if sort_on is None: sort_on = ('+', linkcl.labelprop()) else: sort_on = ('+', sort_on) | sort_on = ('+', linkcl.labelprop()) | def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form select list for this property |
self.serve_file(designator) | try: self.serve_file(designator) except NotModified: self.request.send_response(304) self.request.end_headers() | def inner_main(self): '''Process a request. |
if not row.activity: | if not propvalues.has_key('activity'): | 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... |
m = cStringIO.StringIO() w = MimeWriter.MimeWriter(m) content_type = 'text/plain' | part = writer.nextpart() part.addheader('Content-Disposition','attachment') part.addheader('Content-Description','Message you sent') body = part.startbody('text/plain') | 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... |
header_name = header.split(':')[0] if header_name.lower() == 'content-type': content_type = message.getheader(header_name) elif message.getheader(header_name): w.addheader(header_name, message.getheader(header_name)) body = w.startbody(content_type) | body.write(header) body.write('\n') | 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... |
part = writer.nextpart() part.addheader('Content-Disposition','attachment') part.addheader('Content-Description','Message you sent') part.addheader('Content-Transfer-Encoding', '7bit') body = part.startbody('message/rfc822') body.write(m.getvalue()) | 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 assertRaisesMessage(self, exception, callable, message, *args, **kwargs): | _nocheck = "don't compare exception values (the exception is enough)" def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): | 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 |
self.assertRaisesMessage(Redirect, action.handle, 'BASE/issue') | self.assertRaisesMessage(SeriousError, action.handle, self._nocheck) | def testShowAction(self): self.client.db.config.TRACKER_WEB = 'BASE/' |
option = linkcl.get(optionid, k) | option = linkcl.get(optionid, k) or '' | 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... |
option = linkcl.get(optionid, k) | option = linkcl.get(optionid, k) or '' | def menu(self, size=None, height=None, showid=0, additional=[], **conditions): ''' Render a form select list for this property ''' value = self._value |
url: %(url)r | 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 ''' | |
raise NotImplementedError | for name in 'creation activity creator actor'.split(): if properties.has_key(name): raise ValueError, '"creation", "activity", "creator" and '\ '"actor" are reserved' self.classname = classname self.properties = properties self.db = weakref.proxy(db) self.key = '' self.do_journal = 1 db.addclass(self) actions = "... | def __init__(self, db, classname, **properties): """Create a new class with a given name and property specification. |
raise NotImplementedError | raise NotImplementedError def audit(self, event, detector, priority = 100): """Register an auditor detector""" self.auditors[event].append((priority, detector)) def fireAuditors(self, event, nodeid, newvalues): """Fire all registered auditors""" for prio, audit in self.auditors[event]: audit(self.db, self, nodeid,... | def index(self, nodeid): '''Add (or refresh) the node to search indexes ''' raise NotImplementedError |
libdir = os.path.join(tracker_home, 'lib') if os.path.isdir(libdir): sys.path.insert(1, libdir) | def __init__(self, tracker_home, optimize=0): """New-style tracker instance constructor | |
del sys.path[1] | sys.path.remove(dirpath) | def get_extensions(self, dirname): """Load python extensions |
return _('[hidden]') | return self._('[hidden]') | def history(self): if not self.is_view_ok(): return _('[hidden]') return self._('New node - no history') |
return _('[hidden]') | return self._('[hidden]') | def history(self, direction='descending', dre=re.compile('^\d+$')): if not self.is_view_ok(): return _('[hidden]') |
return _('[hidden]') | return self._('[hidden]') | def plain(self, escape=0, hyperlink=0): '''Render a "plain" representation of the property |
return _('[hidden]') | return self._('[hidden]') | def stext(self, escape=0): ''' Render the value of the property as StructuredText. |
return _('[hidden]') | return self._('[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]') |
return _('[hidden]') | return self._('[hidden]') | def plain(self): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') |
return _('[hidden]') | return self._('[hidden]') | def now(self, str_interval=None): ''' Return the current time. |
raise ValueError, _('default value for ' | raise ValueError, self._('default value for ' | def field(self, size=30, default=None, format=_marker): '''Render a form edit field for the property |
return _('[hidden]') | return self._('[hidden]') | def reldate(self, pretty=1): ''' Render the interval between the date and now. |
return _('[hidden]') | return self._('[hidden]') | def pretty(self, format=_marker): ''' Render the date in a pretty format (eg. month names, spaces). |
return _('[hidden]') | return self._('[hidden]') | def local(self, offset): ''' Return the date/time as a local (timezone offset) date/time. ''' if not self.is_view_ok(): return _('[hidden]') |
return _('[hidden]') | return self._('[hidden]') | def pretty(self): ''' Render the interval in a pretty format (eg. "yesterday") ''' if not self.is_view_ok(): return _('[hidden]') |
raise AttributeError, "Can't access missing value" | msg = self._('Attempt to look up %(attr)s on a missing value') return MissingValue(msg%locals()) | 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) |
return _('[hidden]') | return self._('[hidden]') | def plain(self, escape=0): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return _('[hidden]') |
self.finishRego() return | return self.finishRego() | def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. |
self.cache_lry.insert(0, key) | self.cache_lru.insert(0, key) | def getnode(self, classname, nodeid): ''' Get a node from the database. ''' if __debug__: print >>hyperdb.DEBUG, 'getnode', (self, classname, nodeid) |
del self.cache[self.cache_lru.pop()] | if len(self.cache_lru) > ROW_CACHE_SIZE: del self.cache[self.cache_lru.pop()] | def getnode(self, classname, nodeid): ''' Get a node from the database. ''' if __debug__: print >>hyperdb.DEBUG, 'getnode', (self, classname, nodeid) |
lmt = rfc822.formatdate(lmt) self.additional_headers['Last-Modified'] = lmt | self.additional_headers['Last-Modified'] = rfc822.formatdate(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 |
lmtt = time.gmtime(ims)[:6] | lmtt = time.gmtime(lmt)[:6] | 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 |
raise Unauthorised, _('You do not have permission to ' | raise Unauthorised, self._('You do not have permission to ' | def permission(self): """Check whether the user has permission to execute this action. |
raise ValueError, 'No type specified' | raise ValueError, self._('No type specified') | 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... |
raise SeriousError, _('No ID entered') | raise 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, 'No type specifi... |
raise SeriousError, _( | raise 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, 'No type specifi... |
raise ValueError, _('You may not retire the admin or anonymous user') | raise ValueError, self._( 'You may not retire the admin or anonymous user') | 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 |
_('%(classname)s %(itemid)s has been retired')%{ | self._('%(classname)s %(itemid)s has been retired')%{ | 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 |
self.client.error_message.append(_(rcsv.error)) | self.client.error_message.append(self._(rcsv.error)) | def handle(self): """Performs an edit of all of a class' items in one go. |
_('Not enough values on line %(line)s')%{'line':line}) | self._('Not enough values on line %(line)s')%{'line':line}) | def handle(self): """Performs an edit of all of a class' items in one go. |
self.client.ok_message.append(_('Items edited OK')) | self.client.ok_message.append(self._('Items edited OK')) | def handle(self): """Performs an edit of all of a class' items in one go. |
raise Unauthorised, _("You do not have permission to edit user roles") | raise Unauthorised, self._( "You do not have permission to edit user roles") | def editItemPermission(self, props): """Determine whether the user has permission to edit this item. |
self.client.error_message.append(_('Edit Error: ') + str(message)) | self.client.error_message.append( self._('Edit Error: %s') % str(message)) | def handle(self): """Perform an edit of an item in the database. |
self.client.error_message.append(_('Error: ') + str(message)) | self.client.error_message.append(self._('Error: %s') % str(message)) | def handle(self): ''' Add a new item to the database. |
self.client.error_message.append(_('Error: ') + str(message)) | self.client.error_message.append(_('Error: %s') % str(message)) | def handle(self): ''' Add a new item to the database. |
message = _('You are now registered, welcome!') | message = self._('You are now registered, welcome!') | 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 |
raise Unauthorised, _("It is not permitted to supply roles " "at registration.") | raise Unauthorised, self._( "It is not permitted to supply roles at registration.") | def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. |
self.client.error_message.append(_('Error: A user with the ' | self.client.error_message.append(self._('Error: A user with the ' | def handle(self): """Attempt to create a new user based on the contents of the form and then set the cookie. |
self.client.ok_message.append(_('You are logged out')) | self.client.ok_message.append(self._('You are logged out')) | def handle(self): """Make us really anonymous - nuke the cookie too.""" # log us out self.client.make_user_anonymous() |
self.client.error_message.append(_('Username required')) | self.client.error_message.append(self._('Username required')) | def handle(self): """Attempt to log a user in. |
self.client.error_message.append(_('No such user "%(name)s"')%locals()) | self.client.error_message.append(self._('No such user "%(name)s"') %locals()) | def handle(self): """Attempt to log a user in. |
self.client.error_message.append(_('Incorrect password')) | self.client.error_message.append(self._('Incorrect password')) | def handle(self): """Attempt to log a user in. |
self.client.error_message.append(_("You do not have permission to login")) | self.client.error_message.append( self._("You do not have permission to login")) | def handle(self): """Attempt to log a user in. |
self._value = default | self._value = self._default_value = _value def str2value(self, value): """Return 'value' argument converted to internal representation""" return value def _value2str(self, value): """Return 'value' argument converted to external representation This is actual conversion method called only when value is not NODEFAULT.... | def __init__(self, config, section, setting, default=NODEFAULT, description=None, aliases=None |
self._value = value | self._value = self.str2value(value) | def set(self, value): """Update the value""" self._value = value |
self._value = self.default | self._value = self._default_value | def reset(self): """Reset the value to default""" self._value = self.default |
return self._value == self.default | return self._value == self._default_value | def isdefault(self): """Return True if current value is the default one""" return self._value == self.default |
def str(self, default=0): """Return string representation of the value If 'default' argument is set, format the default value. Otherwise format current value. """ if default: return str(self.default) else: return str(self._value) | def str(self, default=0): """Return string representation of the value | |
return self.str() | return self.value2str(self._value) | def __str__(self): return self.str() |
"default": self.str(default=1), "value": str(self), | "default": self.value2str(self._default_value), "value": self.value2str(self._value), | def __repr__(self): if self.isdefault(): _format = "<%(class)s %(name)s (default): %(value)s>" else: _format = "<%(class)s %(name)s (default: %(default)s): %(value)s>" return _format % { "class": self.__class__.__name__, "name": self.name, "default": self.str(default=1), "value": str(self), } |
"default": self.str(default=1), | "default": self.value2str(self._default_value), | def format(self): """Return .ini file fragment for this option""" _desc_lines = [] for _description in (self.description, self.class_description): if _description: _desc_lines.extend(_description.split("\n")) # comment out the setting line if there is no value if self.isset(): _is_set = "" else: _is_set = "#" _rv = "# ... |
"value": str(self), | "value": self.value2str(self._value), | def format(self): """Return .ini file fragment for this option""" _desc_lines = [] for _description in (self.description, self.class_description): if _description: _desc_lines.extend(_description.split("\n")) # comment out the setting line if there is no value if self.isset(): _is_set = "" else: _is_set = "#" _rv = "# ... |
def str(self, default=0): if default: _val = self.default else: _val = self._value if _val: | def _value2str(self, value): if value: | def str(self, default=0): if default: _val = self.default else: _val = self._value if _val: return "yes" else: return "no" |
def set(self, value): | def str2value(self, value): | def set(self, value): if type(value) == type(""): _val = value.lower() if _val in ("yes", "true", "on", "1"): _val = 1 elif _val in ("no", "false", "off", "0"): _val = 0 else: raise OptionValueError(self, value, self.class_description) else: _val = value and 1 or 0 Option.set(self, _val) |
Option.set(self, _val) | return _val | def set(self, value): if type(value) == type(""): _val = value.lower() if _val in ("yes", "true", "on", "1"): _val = 1 elif _val in ("no", "false", "off", "0"): _val = 0 else: raise OptionValueError(self, value, self.class_description) else: _val = value and 1 or 0 Option.set(self, _val) |
def set(self, value): | def str2value(self, value): | def set(self, value): _val = value.lower() if _val in ("yes", "no", "new"): Option.set(self, _val) else: raise OptionValueError(self, value, self.class_description) |
Option.set(self, _val) | return _val | def set(self, value): _val = value.lower() if _val in ("yes", "no", "new"): Option.set(self, _val) else: raise OptionValueError(self, value, self.class_description) |
def set(self, value): | def str2value(self, value): | def set(self, value): try: _val = float(value) except ValueError: raise OptionValueError(self, value, "Floating point number required") else: Option.set(self, _val) |
_val = float(value) | return float(value) | def set(self, value): try: _val = float(value) except ValueError: raise OptionValueError(self, value, "Floating point number required") else: Option.set(self, _val) |
else: Option.set(self, _val) | def _value2str(self, value): _val = str(value) if _val.endswith(".0"): _val = _val[:-2] return _val | def set(self, value): try: _val = float(value) except ValueError: raise OptionValueError(self, value, "Floating point number required") else: Option.set(self, _val) |
def set(self, value): | def str2value(self, value): | def set(self, value): try: _val = int(value) except ValueError: raise OptionValueError(self, value, "Integer number required") else: Option.set(self, _val) |
_val = int(value) | return int(value) | def set(self, value): try: _val = int(value) except ValueError: raise OptionValueError(self, value, "Integer number required") else: Option.set(self, _val) |
else: Option.set(self, _val) | def set(self, value): try: _val = int(value) except ValueError: raise OptionValueError(self, value, "Integer number required") else: Option.set(self, _val) | |
(Option, "domain", NODEFAULT, "Domain name used for email addresses"), | (Option, "domain", NODEFAULT, "Domain name used for email addresses."), | def set(self, value): try: _val = int(value) except ValueError: raise OptionValueError(self, value, "Integer number required") else: Option.set(self, _val) |
(Option, "username", NODEFAULT, "SMTP login name\n" "Set this if your mail host requires authenticated access"), | (Option, "username", "", "SMTP login name\n" "Set this if your mail host requires authenticated access.\n" "If username is not empty, password (below) MUST be set!"), | def set(self, value): try: _val = int(value) except ValueError: raise OptionValueError(self, value, "Integer number required") else: Option.set(self, _val) |
"Set this if your mail host requires authenticated access"), | "Set this if your mail host requires authenticated access."), | def set(self, value): try: _val = int(value) except ValueError: raise OptionValueError(self, value, "Integer number required") else: Option.set(self, _val) |
(FilePathOption, "tls_keyfile", NODEFAULT, | (FilePathOption, "tls_keyfile", "", | def set(self, value): try: _val = int(value) except ValueError: raise OptionValueError(self, value, "Integer number required") else: Option.set(self, _val) |
(FilePathOption, "tls_certfile", NODEFAULT, | (FilePathOption, "tls_certfile", "", | def set(self, value): try: _val = int(value) except ValueError: raise OptionValueError(self, value, "Integer number required") else: Option.set(self, _val) |
if directions: | if '-' in directions: | def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None), num_re = re.compile('^\d+$')): """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. |
roundup create [-user login] classanme propname=value ... | roundup create [-user login] classname propname=value ... | def usage(): print '''Usage: roundup init roundup spec classname roundup create [-user login] classanme propname=value ... roundup list [-list] classname roundup history [-list] designator roundup get [-list] designator[,designator,...] propname roundup set [-user login] designator[,designator,...] propname=value ... ... |
subject_re = re.compile(r'(?P<refwd>\s*\W?\s*(fwd|re|aw)\W\s*)*' | subject_re = re.compile(r'(?P<refwd>\s*\W?\s*(fw|fwd|re|aw)\W\s*)*' | def getPart(self): ''' Get a single part of a multipart message and return it as a new Message instance. ''' boundary = self.getparam('boundary') mid, end = '--'+boundary, '--'+boundary+'--' s = cStringIO.StringIO() while 1: line = self.fp.readline() if not line: break if line.strip() in (mid, end): break s.write(line)... |
name = part.getparam('name').strip() | name = part.getparam('name') if name: name = name.strip() | def handle_message(self, message): ''' message - a Message instance |
name = disp.getparam('filename').strip() | name = disp.getparam('filename') if name: name = name.strip() | def handle_message(self, message): ''' message - a Message instance |
path = '/'.join((self.env['SCRIPT_NAME'], self.env['TRACKER_NAME'], '')) | def set_cookie(self, user): ''' Set up a session cookie for the user and store away the user's login info against the session. ''' # TODO generate a much, much stronger session key ;) self.session = binascii.b2a_base64(repr(random.random())).strip() | |
'roundup_user_2=%s; expires=%s; Path=%s;'%(self.session, expire, path) | 'roundup_user_2=%s; expires=%s; Path=%s;'%(self.session, expire, self.cookie_path) | def set_cookie(self, user): ''' Set up a session cookie for the user and store away the user's login info against the session. ''' # TODO generate a much, much stronger session key ;) self.session = binascii.b2a_base64(repr(random.random())).strip() |
path = '/'.join((self.env['SCRIPT_NAME'], self.env['TRACKER_NAME'], '')) | def logout_action(self): ''' Make us really anonymous - nuke the cookie too ''' # log us out self.make_user_anonymous() | |
'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path) | 'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, self.cookie_path) | def logout_action(self): ''' Make us really anonymous - nuke the cookie too ''' # log us out self.make_user_anonymous() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.