bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def renderContext(self): ''' Return a PageTemplate for the named page ''' name = self.classname extension = self.template pt = Templates(self.instance.config.TEMPLATES).get(name, extension) | def renderContext(self): ''' Return a PageTemplate for the named page ''' name = self.classname extension = self.template pt = Templates(self.instance.config.TEMPLATES).get(name, extension) | 33,500 |
def inner_main(self): '''Process a request. | def inner_main(self): '''Process a request. | 33,501 |
def shownode(self, message=None): ''' display an item ''' cn = self.classname cl = self.db.classes[cn] | def shownode(self, message=None): ''' display an item ''' cn = self.classname cl = self.db.classes[cn] | 33,502 |
def _post_editnode(self, nid, change_note=None): ''' do the linking and message sending part of the node creation ''' cn = self.classname cl = self.db.classes[cn] # link if necessary keys = self.form.keys() for key in keys: if key == ':multilink': value = self.form[key].value if type(value) != type([]): value = [value]... | def _post_editnode(self, nid, change_note=None): ''' do the linking and message sending part of the node creation ''' cn = self.classname cl = self.db.classes[cn] # link if necessary keys = self.form.keys() for key in keys: if key == ':multilink': value = self.form[key].value if type(value) != type([]): value = [value]... | 33,503 |
def do_display(self, args): '''Usage: display designator[,designator]* Show the property values for the given node(s). | def do_display(self, args): '''Usage: display designator[,designator]* Show the property values for the given node(s). | 33,504 |
def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 33,505 |
def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 33,506 |
def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 33,507 |
def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 33,508 |
def clear(self): for cn in self.classes.keys(): db = os.path.join(self.dir, 'nodes.%s'%cn) bsddb3.btopen(db, 'n') db = os.path.join(self.dir, 'journals.%s'%cn) bsddb3.btopen(db, 'n') | def clear(self): for cn in self.classes.keys(): db = os.path.join(self.dir, 'nodes.%s'%cn) bsddb3.btopen(db, 'n') db = os.path.join(self.dir, 'journals.%s'%cn) bsddb3.btopen(db, 'n') | 33,509 |
def do_reldate(self, property, pretty=0): ''' display a Date property in terms of an interval relative to the current date (e.g. "+ 3w", "- 2d"). | def do_reldate(self, property, pretty=0): ''' display a Date property in terms of an interval relative to the current date (e.g. "+ 3w", "- 2d"). | 33,510 |
def setUp(self): if os.path.exists('test-index'): shutil.rmtree('test-index') os.mkdir('test-index') os.mkdir('test-index/files') from roundup.backends.indexer_dbm import Indexer self.dex = Indexer('test-index') self.dex.load_index() | def setUp(self): if os.path.exists('test-index'): shutil.rmtree('test-index') os.mkdir('test-index') os.mkdir('test-index/files') from roundup.backends.indexer_dbm import Indexer self.dex = Indexer(db) self.dex.load_index() | 33,511 |
def setUp(self): if os.path.exists('text-index'): shutil.rmtree('text-index') from roundup.backends.indexer_xapian import Indexer self.dex = Indexer('.') | def setUp(self): if os.path.exists('test-index'): shutil.rmtree('test-index') os.mkdir('test-index') from roundup.backends.indexer_xapian import Indexer self.dex = Indexer('.') | 33,512 |
def setUp(self): if os.path.exists('text-index'): shutil.rmtree('text-index') from roundup.backends.indexer_xapian import Indexer self.dex = Indexer('.') | def setUp(self): if os.path.exists('text-index'): shutil.rmtree('text-index') from roundup.backends.indexer_xapian import Indexer self.dex = Indexer('.') | 33,513 |
def tearDown(self): shutil.rmtree('text-index') | def tearDown(self): shutil.rmtree('text-index') | 33,514 |
def classhelp(self, properties=None, label=''"(list)", width='500', height='400', property='', form='itemSynopsis', pagesize=50, inputtype="checkbox", sort=None, filter=None): '''Pop up a javascript window with class help | def classhelp(self, properties=None, label=''"(list)", width='500', height='400', property='', form='itemSynopsis', pagesize=50, inputtype="checkbox", sort=None, filter=None): '''Pop up a javascript window with class help | 33,515 |
def stext(self, escape=0): ''' Render the value of the property as StructuredText. | def stext(self, escape=0, hyperlink=1): ''' Render the value of the property as StructuredText. | 33,516 |
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,517 |
def field(self, size = 30): ''' Render the property as a field in HTML. | def field(self, **kwargs): ''' Render the property as a field in HTML. | 33,518 |
def field(self, size = 30): ''' Render the property as a field in HTML. | def field(self, size = 30): ''' Render the property as a field in HTML. | 33,519 |
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,520 |
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,521 |
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,522 |
def import_list(self, propnames, proplist): ''' Import a node - all information including "id" is present and should not be sanity checked. Triggers are not triggered. The journal should be initialised using the "creator" and "created" information. | def import_list(self, propnames, proplist): ''' Import a node - all information including "id" is present and should not be sanity checked. Triggers are not triggered. The journal should be initialised using the "creator" and "created" information. | 33,523 |
def set_cookie(self, user, password): # TODO generate a much, much stronger session key ;) session = binascii.b2a_base64(repr(time.time())).strip() | def set_cookie(self, user, password): # TODO generate a much, much stronger session key ;) session = binascii.b2a_base64(repr(time.time())).strip() | 33,524 |
def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | 33,525 |
def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | 33,526 |
def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | 33,527 |
def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | 33,528 |
def testFilteringDateSortPriorityGroup(self): # '1': '2003-01-01.00:00' 1 => 2 # '2': '2003-02-16.22:50' 3 => 1 # '3': '2003-02-18' 2 => 3 # '4': '2004-03-08' 1 => 2 ae, filt = self.filteringSetup() # ascending ae(filt(None, {}, ('+','deadline'), ('+','priority')), ['2', '1', '4', '3']) ae(filt(None, {}... | def testFilteringDateSortPriorityGroup(self): # '1': '2003-01-01.00:00' 1 => 2 # '2': '2003-02-16.22:50' 3 => 1 # '3': '2003-02-18' 2 => 3 # '4': '2004-03-08' 1 => 2 ae, filt = self.filteringSetup() # ascending ae(filt(None, {}, ('+','deadline'), ('+','priority')), ['2', '1', '4', '3']) # descending ae(... | 33,529 |
def testFilteringDateSortPriorityGroup(self): # '1': '2003-01-01.00:00' 1 => 2 # '2': '2003-02-16.22:50' 3 => 1 # '3': '2003-02-18' 2 => 3 # '4': '2004-03-08' 1 => 2 ae, filt = self.filteringSetup() # ascending ae(filt(None, {}, ('+','deadline'), ('+','priority')), ['2', '1', '4', '3']) ae(filt(None, {}... | def testFilteringDateSortPriorityGroup(self): # '1': '2003-01-01.00:00' 1 => 2 # '2': '2003-02-16.22:50' 3 => 1 # '3': '2003-02-18' 2 => 3 # '4': '2004-03-08' 1 => 2 ae, filt = self.filteringSetup() # ascending ae(filt(None, {}, ('+','deadline'), ('+','priority')), ['2', '1', '4', '3']) ae(filt(None, {}... | 33,530 |
def testFilteringDateSortPriorityGroup(self): # '1': '2003-01-01.00:00' 1 => 2 # '2': '2003-02-16.22:50' 3 => 1 # '3': '2003-02-18' 2 => 3 # '4': '2004-03-08' 1 => 2 ae, filt = self.filteringSetup() # ascending ae(filt(None, {}, ('+','deadline'), ('+','priority')), ['2', '1', '4', '3']) ae(filt(None, {}... | def testFilteringDateSortPriorityGroup(self): # '1': '2003-01-01.00:00' 1 => 2 # '2': '2003-02-16.22:50' 3 => 1 # '3': '2003-02-18' 2 => 3 # '4': '2004-03-08' 1 => 2 ae, filt = self.filteringSetup() # ascending ae(filt(None, {}, ('+','deadline'), ('+','priority')), ['2', '1', '4', '3']) ae(filt(None, {}... | 33,531 |
def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | 33,532 |
def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | 33,533 |
def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | 33,534 |
def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | 33,535 |
def main(self): try: opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:v') except getopt.GetoptError, e: self.usage(str(e)) return 1 | def main(self): try: opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:v') except getopt.GetoptError, e: self.usage(str(e)) return 1 | 33,536 |
def parsePropsFromForm(self, num_re=re.compile('^\d+$')): ''' Item properties and their values are edited with html FORM variables and their values. You can: | def parsePropsFromForm(self, num_re=re.compile('^\d+$')): ''' Item properties and their values are edited with html FORM variables and their values. You can: | 33,537 |
def parsePropsFromForm(self, num_re=re.compile('^\d+$')): ''' Item properties and their values are edited with html FORM variables and their values. You can: | def parsePropsFromForm(self, num_re=re.compile('^\d+$')): ''' Item properties and their values are edited with html FORM variables and their values. You can: | 33,538 |
propdef = all_propdef[cn] | propdef = all_propdef[cn] | 33,539 |
propdef = all_propdef[cn] | propdef = all_propdef[cn] | 33,540 |
def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy', from_address=[], cc=[], bcc=[]): """Send a message to the members of an issue's nosy list. | def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy', from_address=None, cc=[]): """Send a message to the members of an issue's nosy list. | 33,541 |
def __cmp__(self, other): if isinstance(other, HTMLProperty): return cmp(self._value, other._value) return cmp(self._value, other) | def __cmp__(self, other): if isinstance(other, HTMLProperty): return cmp(self._value, other._value) return cmp(self._value, other) | 33,542 |
def plain(self, escape=0, hyperlink=0): ''' Render a "plain" representation of the property "escape" turns on/off HTML quoting "hyperlink" turns on/off in-text hyperlinking of URLs, email addresses and designators ''' if self._value is None: return '' if escape: s = cgi.escape(str(self._value)) else: s = str(self._val... | def plain(self, escape=0, hyperlink=0): ''' Render a "plain" representation of the property "escape" turns on/off HTML quoting "hyperlink" turns on/off in-text hyperlinking of URLs, email addresses and designators ''' if self._value is None: return '' if escape: s = cgi.escape(str(self._value)) else: s = str(self._val... | 33,543 |
def init(instance_home, template, backend, adminpw): ''' initialise an instance using the named template ''' # first, copy the template dir over import roundup.templatebuilder template_dir = os.path.split(__file__)[0] template_name = template template = os.path.join(template_dir, 'templates', template) copytree(templa... | def init(instance_home, template, backend, adminpw): ''' initialise an instance using the named template ''' # first, copy the template dir over import roundup.templatebuilder template_dir = os.path.split(__file__)[0] template_name = template template = os.path.join(template_dir, 'templates', template) copytree(templa... | 33,544 |
def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 33,545 |
def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 33,546 |
def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | def run(port=PORT, success_message=None): ''' Script entry point - handle args and figure out what to to. ''' # time out after a minute if we can import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) hostname = HOSTNAME pidfile = PIDFILE logfile = LOGFILE user = ROUNDUP_USER group = ROUND... | 33,547 |
def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): """An extension of assertRaises, which also checks the exception message. We need this because we rely on exception messages when redirecting. """ try: callable(*args, **kwargs) except exception, msg: self.assertEqual(str(msg), message) else:... | def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): """An extension of assertRaises, which also checks the exception message. We need this because we rely on exception messages when redirecting. """ try: callable(*args, **kwargs) except exception, msg: self.assertEqual(str(msg), message) else:... | 33,548 |
def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): """An extension of assertRaises, which also checks the exception message. We need this because we rely on exception messages when redirecting. """ try: callable(*args, **kwargs) except exception, msg: self.assertEqual(str(msg), message) else:... | def assertRaisesMessage(self, exception, callable, message, *args, **kwargs): """An extension of assertRaises, which also checks the exception message. We need this because we rely on exception messages when redirecting. """ try: callable(*args, **kwargs) except exception, msg: self.assertEqual(str(msg), message) else:... | 33,549 |
def setUp(self): SearchActionTestCase.setUp(self) self.client.db.classes.getprops = lambda: {'foo': hyperdb.Multilink('foo')} | def setUp(self): SearchActionTestCase.setUp(self) self.client.db.classes.getprops = lambda: {'foo': hyperdb.Multilink('foo')} | 33,550 |
def testTokenizedStringKey(self): self.client.db.classes.getprops = lambda: {'foo': hyperdb.String()} self.form.value.append(MiniFieldStorage('foo', 'hello world')) | def testTokenizedStringKey(self): self.client.db.classes.getprops = lambda: {'foo': hyperdb.String()} self.form.value.append(MiniFieldStorage('foo', 'hello world')) | 33,551 |
def testLastUserActivity(self): self.assertEqual(self.action.lastUserActivity(), None) | def testLastUserActivity(self): self.assertEqual(self.action.lastUserActivity(), None) | 33,552 |
def testCollision(self): self.failUnless(self.action.detectCollision(self.now, self.now + Interval("1d"))) self.failIf(self.action.detectCollision(self.now, self.now - Interval("1d"))) self.failIf(self.action.detectCollision(None, self.now)) | def testCollision(self): self.failUnless(self.action.detectCollision( self.now, self.now + Interval("1d"))) self.failIf(self.action.detectCollision( self.now, self.now - Interval("1d"))) self.failIf(self.action.detectCollision(None, self.now)) | 33,553 |
def searchAction(self, wcre=re.compile(r'[\s,]+')): ''' Mangle some of the form variables. | def searchAction(self, wcre=re.compile(r'[\s,]+')): ''' Mangle some of the form variables. | 33,554 |
def index(self): ''' Print up an index of the available instances ''' self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() w = self.wfile.write w(_('<html><head><title>Roundup instances index</title></head>\n')) w(_('<body><h1>Roundup instances index</h1><ol>\n')) for instance in sel... | def index(self): ''' Print up an index of the available trackers ''' self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() w = self.wfile.write w(_('<html><head><title>Roundup instances index</title></head>\n')) w(_('<body><h1>Roundup instances index</h1><ol>\n')) for instance in self... | 33,555 |
def index(self): ''' Print up an index of the available instances ''' self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() w = self.wfile.write w(_('<html><head><title>Roundup instances index</title></head>\n')) w(_('<body><h1>Roundup instances index</h1><ol>\n')) for instance in sel... | def index(self): ''' Print up an index of the available instances ''' self.send_response(200) self.send_header('Content-Type', 'text/html') self.end_headers() w = self.wfile.write w(_('<html><head><title>Roundup trackers index</title></head>\n')) w(_('<body><h1>Roundup trackers index</h1><ol>\n')) keys = self.TRACKER_H... | 33,556 |
def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | 33,557 |
def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | 33,558 |
def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | 33,559 |
def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' | 33,560 |
def usage(message=''): if message: message = _('Error: %(error)s\n\n')%{'error': message} print _('''%(message)sUsage: | def usage(message=''): if message: message = _('Error: %(error)s\n\n')%{'error': message} print _('''%(message)sUsage: | 33,561 |
def usage(message=''): if message: message = _('Error: %(error)s\n\n')%{'error': message} print _('''%(message)sUsage: | def usage(message=''): if message: message = _('Error: %(error)s\n\n')%{'error': message} print _('''%(message)sUsage: | 33,562 |
def usage(message=''): if message: message = _('Error: %(error)s\n\n')%{'error': message} print _('''%(message)sUsage: | def usage(message=''): if message: message = _('Error: %(error)s\n\n')%{'error': message} print _('''%(message)sUsage: | 33,563 |
def run(): ''' Script entry point - handle args and figure out what to to. ''' hostname = '' port = 8080 pidfile = None logfile = None try: # handle the command-line args try: optlist, args = getopt.getopt(sys.argv[1:], 'n:p:u:d:l:') except getopt.GetoptError, e: usage(str(e)) user = ROUNDUP_USER for (opt, arg) in opt... | def run(): ''' Script entry point - handle args and figure out what to to. ''' hostname = '' port = 8080 pidfile = None logfile = None try: # handle the command-line args try: optlist, args = getopt.getopt(sys.argv[1:], 'n:p:u:d:l:') except getopt.GetoptError, e: usage(str(e)) user = ROUNDUP_USER for (opt, arg) in opt... | 33,564 |
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,565 |
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,566 |
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,567 |
def lookup(self, keyvalue): '''Locate a particular node by its key property and return its id. | def lookup(self, keyvalue): '''Locate a particular node by its key property and return its id. | 33,568 |
def lookup(self, keyvalue): '''Locate a particular node by its key property and return its id. | def lookup(self, keyvalue): '''Locate a particular node by its key property and return its id. | 33,569 |
def lookup(self, keyvalue): '''Locate a particular node by its key property and return its id. | def lookup(self, keyvalue): '''Locate a particular node by its key property and return its id. | 33,570 |
def gettext(self, msgid): """Return the localized translation of msgid""" return templating.translationService.translate(domain="roundup", msgid=msgid, context=self.context) | def gettext(self, msgid): """Return the localized translation of msgid""" return templating.translationService.translate(domain="roundup", msgid=msgid, context=self.context) | 33,571 |
def handle(self): ''' Export the specified search query as CSV. ''' # figure the request request = templating.HTMLRequest(self.client) filterspec = request.filterspec sort = request.sort group = request.group columns = request.columns klass = self.db.getclass(request.classname) | def handle(self): ''' Export the specified search query as CSV. ''' # figure the request request = templating.HTMLRequest(self.client) filterspec = request.filterspec sort = request.sort group = request.group columns = request.columns klass = self.db.getclass(request.classname) | 33,572 |
def get(self, nodeid, propname, default=_marker, cache=1): '''Get the value of a property on an existing node of this class. | def get(self, nodeid, propname, default=_marker, cache=1): '''Get the value of a property on an existing node of this class. | 33,573 |
def pretty(self, format='%d %B %Y'): ''' print up the date date using a pretty format... | def pretty(self, format='%d %B %Y'): ''' print up the date date using a pretty format... | 33,574 |
def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password [key=val[,key=val]]]]] Install a new Roundup tracker. | 33,575 |
def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | def do_install(self, tracker_home, args): ""'''Usage: install [template [backend [admin password]]] Install a new Roundup tracker. | 33,576 |
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 import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) config = ServerConfig() options = "hvS" if RoundupService: options += 'c' try: (opt... | 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 import socket if hasattr(socket, 'setdefaulttimeout'): socket.setdefaulttimeout(60) config = ServerConfig() options = "hvS" if RoundupService: options += 'c' try: (opt... | 33,577 |
def load_extensions(self, parent, dirname): dirname = os.path.join(self.tracker_home, dirname) 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): dirpath = os.path.join(self.tracker_home, dirname) if os.path.isdir(dirpath): for name in os.listdir(dirpath): if not name.endswith('.py'): continue vars = {} self._load_python(os.path.join(dirname, name), vars) vars['init'](parent) | 33,578 |
def showuser(self, message=None): ''' display an item ''' if self.user in ('admin', self.db.user.get(self.nodeid, 'username')): self.shownode(message) else: raise Unauthorised | def showuser(self, message=None): '''Display a user page for editing. Make sure the user is allowed to edit this node, and also check for password changes. ''' if self.user == 'anonymous': raise Unauthorised | 33,579 |
def login_action(self, message=None): if not self.form.has_key('__login_name'): return self.login(message='Username required') self.user = self.form['__login_name'].value if self.form.has_key('__login_password'): password = self.form['__login_password'].value else: password = '' print self.user, password # make sure th... | def login_action(self, message=None): if not self.form.has_key('__login_name'): return self.login(message='Username required') self.user = self.form['__login_name'].value if self.form.has_key('__login_password'): password = self.form['__login_password'].value else: password = '' # make sure the user exists try: uid = s... | 33,580 |
def login_action(self, message=None): if not self.form.has_key('__login_name'): return self.login(message='Username required') self.user = self.form['__login_name'].value if self.form.has_key('__login_password'): password = self.form['__login_password'].value else: password = '' print self.user, password # make sure th... | def login_action(self, message=None): if not self.form.has_key('__login_name'): return self.login(message='Username required') self.user = self.form['__login_name'].value if self.form.has_key('__login_password'): password = self.form['__login_password'].value else: password = '' print self.user, password # make sure th... | 33,581 |
def logout(self, message=None): self.make_user_anonymous() # construct the logout cookie path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) now = Cookie._getdate() self.header({'Set-Cookie': 'roundup_user=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) return self.login() | def logout(self, message=None): self.make_user_anonymous() # construct the logout cookie now = Cookie._getdate() self.header({'Set-Cookie': 'roundup_user=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) return self.login() | 33,582 |
def logout(self, message=None): self.make_user_anonymous() # construct the logout cookie path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) now = Cookie._getdate() self.header({'Set-Cookie': 'roundup_user=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, path)}) return self.login() | def logout(self, message=None): self.make_user_anonymous() # construct the logout cookie path = '/'.join((self.env['SCRIPT_NAME'], self.env['INSTANCE_NAME'], '')) now = Cookie._getdate() self.header({'Set-Cookie': 'roundup_user=deleted; Max-Age=0; expires="%s"; Path="%s";'%(now, path)}) return self.login() | 33,583 |
def newuser_action(self, message=None): ''' create a new user based on the contents of the form and then set the cookie ''' # re-open the database as "admin" self.db.close() self.db = self.instance.open('admin') | def newuser_action(self, message=None): ''' create a new user based on the contents of the form and then set the cookie ''' # re-open the database as "admin" self.db.close() self.db = self.instance.open('admin') | 33,584 |
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 | 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 | 33,585 |
def open(name=None): ''' as from the roundupdb method openDB ''' from roundup.hyperdb import String, Password, Date, Link, Multilink from roundup.hyperdb import Interval, Boolean, Number # open the database db = Database(config, name) # # Now initialise the schema. Must do this each time the database is # opened. # ... | def open(name=None): ''' as from the roundupdb method openDB ''' from roundup.hyperdb import String, Password, Date, Link, Multilink from roundup.hyperdb import Interval, Boolean, Number # open the database db = Database(config, name # # Now initialise the schema. Must do this each time the database is # opened. # # ... | 33,586 |
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(... | 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(... | 33,587 |
def get(self, nodeid, propname, default=_marker, cache=1): '''Get the value of a property on an existing node of this class. | def get(self, nodeid, propname, default=_marker, cache=1): '''Get the value of a property on an existing node of this class. | 33,588 |
def generateChangeNote(self, nodeid, oldvalues): """Generate a change note that lists property changes """ if __debug__ : if not isinstance(oldvalues, type({})) : raise TypeError("'oldvalues' must be dict-like, not %s."% type(oldvalues)) | def generateChangeNote(self, nodeid, oldvalues): """Generate a change note that lists property changes """ if __debug__ : if not isinstance(oldvalues, type({})) : raise TypeError("'oldvalues' must be dict-like, not %s."% type(oldvalues)) | 33,589 |
def find_template(dir, name, view): ''' Find a template in the nominated dir ''' # find the source if view: filename = '%s.%s'%(name, view) else: filename = name # try old-style src = os.path.join(dir, filename) if os.path.exists(src): return (src, filename) # try with a .html or .xml extension (new-style) for extens... | def find_template(dir, name, view): ''' Find a template in the nominated dir ''' # find the source if view: filename = '%s.%s'%(name, view) else: filename = name # try old-style src = os.path.join(dir, filename) if os.path.exists(src): return (src, filename) # try with a .html or .xml extension (new-style) for extens... | 33,590 |
def find_template(dir, name, view): ''' Find a template in the nominated dir ''' # find the source if view: filename = '%s.%s'%(name, view) else: filename = name # try old-style src = os.path.join(dir, filename) if os.path.exists(src): return (src, filename) # try with a .html or .xml extension (new-style) for extens... | def find_template(dir, name, view): ''' Find a template in the nominated dir ''' # find the source if view: filename = '%s.%s'%(name, view) else: filename = name # try old-style src = os.path.join(dir, filename) if os.path.exists(src): return (src, f) # try with a .html or .xml extension (new-style) for extension in ... | 33,591 |
def testInterval(self): ae = self.assertEqual ae(str(Interval('3y')), '+ 3y') ae(str(Interval('2 y 1 m')), '+ 2y 1m') ae(str(Interval('1m 25d')), '+ 1m 25d') ae(str(Interval('-2w 3 d ')), '- 1 7d') ae(str(Interval(' - 1 d 2:50 ')), '- 1d 2:50') ae(str(Interval(' 14:00 ')), '+ 14:00') ae(str(Interval(' 0:04:33 ')), '+ 0... | def testInterval(self): ae = self.assertEqual ae(str(Interval('3y')), '+ 3y') ae(str(Interval('2 y 1 m')), '+ 2y 1m') ae(str(Interval('1m 25d')), '+ 1m 25d') ae(str(Interval('-2w 3 d ')), '- 17d') ae(str(Interval(' - 1 d 2:50 ')), '- 1d 2:50') ae(str(Interval(' 14:00 ')), '+ 14:00') ae(str(Interval(' 0:04:33 ')), '+ 0:... | 33,592 |
def export_journals(self): '''Export a class's journal - generate a list of lists of CSV-able data: | def export_journals(self): '''Export a class's journal - generate a list of lists of CSV-able data: | 33,593 |
def history(self, direction='descending'): l = ['<table class="history">' '<tr><th colspan="4" class="header">', _('History'), '</th></tr><tr>', _('<th>Date</th>'), _('<th>User</th>'), _('<th>Action</th>'), _('<th>Args</th>'), '</tr>'] comments = {} history = self._klass.history(self._nodeid) history.sort() if directio... | def history(self, direction='descending', dre=re.compile('\d+')): l = ['<table class="history">' '<tr><th colspan="4" class="header">', _('History'), '</th></tr><tr>', _('<th>Date</th>'), _('<th>User</th>'), _('<th>Action</th>'), _('<th>Args</th>'), '</tr>'] comments = {} history = self._klass.history(self._nodeid) his... | 33,594 |
def plain(self): ''' Render a "plain" representation of the property ''' if self.value is None: return '' return self._value and "Yes" or "No" | def plain(self): ''' Render a "plain" representation of the property ''' if self._value is None: return '' return self._value and "Yes" or "No" | 33,595 |
def create_journal_table(self, spec): ''' create the journal table for a class given the spec and already-determined cols ''' # journal table cols = ','.join(['%s varchar'%x for x in 'nodeid date tag action params'.split()]) sql = '''create table %s__journal ( nodeid integer, date timestamp, tag varchar(255), action va... | def create_journal_table(self, spec): ''' create the journal table for a class given the spec and already-determined cols ''' # journal table cols = ','.join(['%s varchar'%x for x in 'nodeid date tag action params'.split()]) sql = '''create table %s__journal ( nodeid integer, date %s, tag varchar(255), action varchar(2... | 33,596 |
def now(self, str_interval = None): ''' Return the current time. | def now(self, str_interval = None): ''' Return the current time. | 33,597 |
def field(self, size = 30, default = None): ''' Render a form edit field for the property | def field(self, size = 30, default = None): ''' Render a form edit field for the property | 33,598 |
def props_from_args(self, args, klass=None): props = {} for arg in args: if arg.find('=') == -1: raise UsageError, _('argument "%(arg)s" not propname=value')%locals() try: key, value = arg.split('=') except ValueError: raise UsageError, _('argument "%(arg)s" not propname=value')%locals() props[key] = value return props | def props_from_args(self, args): props = {} for arg in args: if arg.find('=') == -1: raise UsageError, _('argument "%(arg)s" not propname=value')%locals() try: key, value = arg.split('=') except ValueError: raise UsageError, _('argument "%(arg)s" not propname=value')%locals() props[key] = value return props | 33,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.