bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def help_all(self): print _(''' | def help_all(self): print _(''' | 34,000 |
def help_all(self): print _(''' | def help_all(self): print _(''' | 34,001 |
def help_all(self): print _(''' | def help_all(self): print _(''' | 34,002 |
def help_all(self): print _(''' | def help_all(self): print _(''' | 34,003 |
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. | 34,004 |
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. | 34,005 |
def do_get(self, args): ""'''Usage: get property designator[,designator]* Get the given property of one or more designator(s). | def do_get(self, args): ""'''Usage: get property designator[,designator]* Get the given property of one or more designator(s). | 34,006 |
def do_set(self, args, pwre = re.compile(r'{(\w+)}(.+)')): ""'''Usage: set items property=value property=value ... Set the given properties of one or more items(s). | def do_set(self, args, pwre = re.compile(r'{(\w+)}(.+)')): ""'''Usage: set items property=value property=value ... Set the given properties of one or more items(s). | 34,007 |
def do_find(self, args): ""'''Usage: find classname propname=value ... Find the nodes of the given class with a given link property value. | def do_find(self, args): ""'''Usage: find classname propname=value ... Find the nodes of the given class with a given link property value. | 34,008 |
def do_list(self, args): ""'''Usage: list classname [property] List the instances of a class. | def do_list(self, args): ""'''Usage: list classname [property] List the instances of a class. | 34,009 |
def do_table(self, args): ""'''Usage: table classname [property[,property]*] List the instances of a class in tabular form. | def do_table(self, args): ""'''Usage: table classname [property[,property]*] List the instances of a class in tabular form. | 34,010 |
def do_retire(self, args): ""'''Usage: retire designator[,designator]* Retire the node specified by designator. | def do_retire(self, args): ""'''Usage: retire designator[,designator]* Retire the node specified by designator. | 34,011 |
def do_import(self, args): ""'''Usage: import import_dir Import a database from the directory containing CSV files, two per class to import. | def do_import(self, args): ""'''Usage: import import_dir Import a database from the directory containing CSV files, two per class to import. | 34,012 |
def do_reindex(self, args): ""'''Usage: reindex Re-generate a tracker's search indexes. | def do_reindex(self, args): ""'''Usage: reindex Re-generate a tracker's search indexes. | 34,013 |
def filter(self, filterspec, sort, group, 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 ''' cn = self.classname | def filter(self, filterspec, sort, group, 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 ''' cn = self.classname | 34,014 |
def filter(self, filterspec, sort, group, 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 ''' cn = self.classname | def filter(self, filterspec, sort, group, 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 ''' cn = self.classname | 34,015 |
def Choice(name, *options): cl = Class(db, name, name=hyperdb.String(), order=hyperdb.String()) for i in range(len(options)): cl.create(name=option[i], order=i) return hyperdb.Link(name) | def Choice(name, *options): cl = Class(db, name, name=hyperdb.String(), order=hyperdb.String()) for i in range(len(options)): cl.create(name=option[i], order=i) return hyperdb.Link(name) | 34,016 |
def add(id, str, fuzzy): "Add a non-fuzzy translation to the dictionary." global MESSAGES if not fuzzy and str: MESSAGES[id] = str | def add(id, str, fuzzy): "Add a non-fuzzy translation to the dictionary." global MESSAGES if not fuzzy and str and not str.startswith('\0'): MESSAGES[id] = str | 34,017 |
def make(filename, outfile): ID = 1 STR = 2 # Compute .mo name from .po name and arguments if filename.endswith('.po'): infile = filename else: infile = filename + '.po' if outfile is None: outfile = os.path.splitext(infile)[0] + '.mo' try: lines = open(infile).readlines() except IOError, msg: print >> sys.stderr, ms... | def make(filename, outfile): ID = 1 STR = 2 # Compute .mo name from .po name and arguments if filename.endswith('.po'): infile = filename else: infile = filename + '.po' if outfile is None: outfile = os.path.splitext(infile)[0] + '.mo' try: lines = open(infile).readlines() except IOError, msg: print >> sys.stderr, ms... | 34,018 |
def create_check(self): ''' Raise the Unauthorised exception if the user's not permitted to create items of this class. ''' if not self.is_create_ok(): raise Unauthorised("create", self._classname, translator=self._client.translator) | def create_check(self): ''' Raise the Unauthorised exception if the user's not permitted to create items of this class. ''' if not self.is_create_ok(): raise Unauthorised("create", self._classname, translator=self._client.translator) | 34,019 |
def is_view_ok(self): ''' Is the user allowed to View the current class? ''' if self._db.security.hasPermission('View', self._client.userid, self._classname): return 1 return self.is_create_ok() | def is_view_ok(self): ''' Is the user allowed to View the current class? ''' if self._db.security.hasPermission('View', self._client.userid, self._classname): return 1 return self.is_create_ok() | 34,020 |
def is_only_view_ok(self): ''' Is the user only allowed to View (ie. not Create) the current class? ''' return self.is_view_ok() and not self.is_create_ok() | def is_only_view_ok(self): ''' Is the user only allowed to View (ie. not Create) the current class? ''' return self.is_view_ok() and not self.is_create_ok() | 34,021 |
def clean_sessions(self): ''' Age sessions, remove when they haven't been used for a week. Do it only once an hour. | def clean_sessions(self): ''' Age sessions, remove when they haven't been used for a week. Do it only once an hour. | 34,022 |
def clean_sessions(self): ''' Age sessions, remove when they haven't been used for a week. Do it only once an hour. | def clean_sessions(self): ''' Age sessions, remove when they haven't been used for a week. Do it only once an hour. | 34,023 |
def sendEmail(self, to, subject, content): # send email to the user's email address message = StringIO.StringIO() writer = MimeWriter.MimeWriter(message) tracker_name = self.db.config.TRACKER_NAME writer.addheader('Subject', encode_header(subject)) writer.addheader('To', to) writer.addheader('From', roundupdb.straddr((... | def sendEmail(self, to, subject, content): # send email to the user's email address message = StringIO.StringIO() writer = MimeWriter.MimeWriter(message) tracker_name = self.db.config.TRACKER_NAME writer.addheader('Subject', encode_header(subject)) writer.addheader('To', to) writer.addheader('From', roundupdb.straddr((... | 34,024 |
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. | 34,025 |
def setUp(self): from roundup.backends import anydbm # remove previous test, ignore errors if os.path.exists(config.DATABASE): shutil.rmtree(config.DATABASE) os.makedirs(config.DATABASE + '/files') self.db = anydbm.Database(config, 'admin') setupSchema(self.db, 1, anydbm) | def setUp(self): backend = backends.get_backend('anydbm') # remove previous test, ignore errors if os.path.exists(config.DATABASE): shutil.rmtree(config.DATABASE) os.makedirs(config.DATABASE + '/files') self.db = anydbm.Database(config, 'admin') setupSchema(self.db, 1, anydbm) | 34,026 |
def setUp(self): from roundup.backends import anydbm # remove previous test, ignore errors if os.path.exists(config.DATABASE): shutil.rmtree(config.DATABASE) os.makedirs(config.DATABASE + '/files') self.db = anydbm.Database(config, 'admin') setupSchema(self.db, 1, anydbm) | def setUp(self): from roundup.backends import anydbm # remove previous test, ignore errors if os.path.exists(config.DATABASE): shutil.rmtree(config.DATABASE) os.makedirs(config.DATABASE + '/files') self.db = anydbm.Database(config, 'admin') setupSchema(self.db, 1, anydbm) | 34,027 |
def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PermissionTest)) return suite | def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PermissionTest)) return suite | 34,028 |
def create_inner(self, **propvalues): ''' Called by create, in-between the audit and react calls. ''' if propvalues.has_key('id'): raise KeyError, '"id" is reserved' | def create_inner(self, **propvalues): ''' Called by create, in-between the audit and react calls. ''' if propvalues.has_key('id'): raise KeyError, '"id" is reserved' | 34,029 |
def create(self, **propvalues): ''' Snarf the "content" propvalue and store in a file ''' # we need to fire the auditors now, or the content property won't # be in propvalues for the auditors to play with self.fireAuditors('create', None, propvalues) | def create(self, **propvalues): ''' Snarf the "content" propvalue and store in a file ''' # we need to fire the auditors now, or the content property won't # be in propvalues for the auditors to play with self.fireAuditors('create', None, propvalues) | 34,030 |
def test_basics(self): self.dex.add_text('testing1', 'a the hello world') self.assertEqual(self.dex.words, {'HELLO': {1: 1}, 'WORLD': {1: 1}}) self.dex.add_text('testing2', 'blah blah the world') self.assertEqual(self.dex.words, {'BLAH': {2: 2}, 'HELLO': {1: 1}, 'WORLD': {2: 1, 1: 1}}) self.assertEqual(self.dex.find(['... | def test_basics(self): self.dex.add_text('testing1', 'a the hello world') self.assertEqual(self.dex.words, {'HELLO': {1: 1}, 'WORLD': {1: 1}}) self.dex.add_text('testing2', 'blah blah the world') self.assertEqual(self.dex.words, {'BLAH': {2: 2}, 'HELLO': {1: 1}, 'WORLD': {2: 1, 1: 1}}) self.assertEqual(self.dex.find(['... | 34,031 |
def clean_sessions(self): ''' Age sessions, remove when they haven't been used for a week. Do it only once an hour. | def clean_sessions(self): """Age sessions, remove when they haven't been used for a week. Do it only once an hour. | 34,032 |
def clean_sessions(self): ''' Age sessions, remove when they haven't been used for a week. Do it only once an hour. | def clean_sessions(self): ''' Age sessions, remove when they haven't been used for a week. Do it only once an hour. | 34,033 |
def determine_user(self): ''' Determine who the user is ''' # open the database as admin self.opendb('admin') | def determine_user(self): '''Determine who the user is. ''' # open the database as admin self.opendb('admin') | 34,034 |
def determine_context(self, dre=re.compile(r'([^\d]+)(\d+)')): ''' Determine the context of this page from the URL: | def determine_context(self, dre=re.compile(r'([^\d]+)(\d+)')): ''' Determine the context of this page from the URL: | 34,035 |
def determine_context(self, dre=re.compile(r'([^\d]+)(\d+)')): ''' Determine the context of this page from the URL: | def determine_context(self, dre=re.compile(r'([^\d]+)(\d+)')): """ Determine the context of this page from the URL: | 34,036 |
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() | def set_cookie(self, user): """Set up a session cookie for the user. Also 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() | 34,037 |
def passResetAction(self): ''' Handle password reset requests. | def passResetAction(self): ''' Handle password reset requests. | 34,038 |
def editItemPermission(self, props): ''' Determine whether the user has permission to edit this item. | def editItemPermission(self, props): ''' Determine whether the user has permission to edit this item. | 34,039 |
def editCSVAction(self): ''' Performs an edit of all of a class' items in one go. | def editCSVAction(self): ''' Performs an edit of all of a class' items in one go. | 34,040 |
def editCSVAction(self): ''' Performs an edit of all of a class' items in one go. | def editCSVAction(self): """ Performs an edit of all of a class' items in one go. | 34,041 |
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: | 34,042 |
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: | 34,043 |
propdef = all_propdef[cn] | propdef = all_propdef[cn] | 34,044 |
propdef = all_propdef[cn] | propdef = all_propdef[cn] | 34,045 |
def get_backend(name): '''Get a specific backend by name.''' vars = globals() # if requested backend has been imported yet, return current instance if vars.has_key(name): return vars[name] # import the backend module module_name = 'back_%s' % name try: module = __import__(module_name, vars) except: # import failed, but... | def get_backend(name): '''Get a specific backend by name.''' vars = globals() # if requested backend has been imported yet, return current instance if vars.has_key(name): return vars[name] # import the backend module module_name = 'back_%s' % name try: module = __import__(module_name, vars) except: # import failed, but... | 34,046 |
def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' rest = self.path | def inner_run_cgi(self): ''' This is the inner part of the CGI handling ''' rest = self.path | 34,047 |
def address_string(self): if self.LOG_IPADDRESS: return self.client_address[0] else: host, port = self.client_address return socket.getfqdn(host) | def address_string(self): if self.LOG_IPADDRESS: return self.client_address[0] else: host, port = self.client_address return socket.getfqdn(host) | 34,048 |
def run(): ''' 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 = '' port = 8080 pidfile = None logfile = None try: # handle the command-line args try: optlist, args = getopt.... | def run(): ''' 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 = '' port = 8080 pidfile = None logfile = None try: # handle the command-line args try: optlist, args = getopt.... | 34,049 |
def run(): ''' 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 = '' port = 8080 pidfile = None logfile = None try: # handle the command-line args try: optlist, args = getopt.... | def run(): ''' 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 = '' port = 8080 pidfile = None logfile = None try: # handle the command-line args try: optlist, args = getopt.... | 34,050 |
def run(): ''' 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 = '' port = 8080 pidfile = None logfile = None try: # handle the command-line args try: optlist, args = getopt.... | def run(): ''' 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 = '' port = 8080 pidfile = None logfile = None try: # handle the command-line args try: optlist, args = getopt.... | 34,051 |
def setUp(self): self.dirname = '_test_cgi_form' try: shutil.rmtree(self.dirname) except OSError, error: if error.errno not in (errno.ENOENT, errno.ESRCH): raise # create the instance init.install(self.dirname, 'templates/classic') init.write_select_db(self.dirname, 'anydbm') init.initialise(self.dirname, 'sekrit') # ... | def setUp(self): self.dirname = '_test_cgi_form' try: shutil.rmtree(self.dirname) except OSError, error: if error.errno not in (errno.ENOENT, errno.ESRCH): raise # create the instance init.install(self.dirname, 'templates/classic') init.write_select_db(self.dirname, 'anydbm') init.initialise(self.dirname, 'sekrit') # ... | 34,052 |
def setUp(self): self.dirname = '_test_cgi_form' try: shutil.rmtree(self.dirname) except OSError, error: if error.errno not in (errno.ENOENT, errno.ESRCH): raise # create the instance init.install(self.dirname, 'templates/classic') init.write_select_db(self.dirname, 'anydbm') init.initialise(self.dirname, 'sekrit') # ... | def setUp(self): self.dirname = '_test_cgi_form' try: shutil.rmtree(self.dirname) except OSError, error: if error.errno not in (errno.ENOENT, errno.ESRCH): raise # create the instance init.install(self.dirname, 'templates/classic') init.write_select_db(self.dirname, 'anydbm') init.initialise(self.dirname, 'sekrit') # ... | 34,053 |
def testMixedMultilink(self): form = cgi.FieldStorage() form.list.append(cgi.MiniFieldStorage('nosy', '1,2')) form.list.append(cgi.MiniFieldStorage('nosy', '3')) cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, form) cl.classname = 'issue' cl.nodeid = None cl.db = self.db self.assertEqual(cl.parsePropsFromFor... | def testMixedMultilink(self): form = cgi.FieldStorage() form.list.append(cgi.MiniFieldStorage('nosy', '1,2')) form.list.append(cgi.MiniFieldStorage('nosy', '3')) cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, form) cl.classname = 'issue' cl.nodeid = None cl.db = self.db self.assertEqual(cl.parsePropsFromFor... | 34,054 |
def testEmptyMultilinkSet(self): nodeid = self.db.issue.create(nosy=['1','2']) self.assertEqual(self.parseForm({'nosy': ''}, 'issue', nodeid), ({('issue', nodeid): {'nosy': []}}, [])) nodeid = self.db.issue.create(nosy=['1','2']) self.assertEqual(self.parseForm({'nosy': ' '}, 'issue', nodeid), ({('issue', nodeid): {'no... | def testEmptyMultilinkSet(self): nodeid = self.db.issue.create(nosy=['1','2']) self.assertEqual(self.parseForm({'nosy': ''}, 'issue', nodeid), ({('issue', nodeid): {'nosy': []}}, [])) nodeid = self.db.issue.create(nosy=['1','2']) self.assertEqual(self.parseForm({'nosy': ' '}, 'issue', nodeid), ({('issue', nodeid): {'no... | 34,055 |
def testEmptyMultilinkSet(self): nodeid = self.db.issue.create(nosy=['1','2']) self.assertEqual(self.parseForm({'nosy': ''}, 'issue', nodeid), ({('issue', nodeid): {'nosy': []}}, [])) nodeid = self.db.issue.create(nosy=['1','2']) self.assertEqual(self.parseForm({'nosy': ' '}, 'issue', nodeid), ({('issue', nodeid): {'no... | def testEmptyMultilinkSet(self): nodeid = self.db.issue.create(nosy=['1','2']) self.assertEqual(self.parseForm({'nosy': ''}, 'issue', nodeid), ({('issue', nodeid): {'nosy': []}}, [])) nodeid = self.db.issue.create(nosy=['1','2']) self.assertEqual(self.parseForm({'nosy': ' '}, 'issue', nodeid), ({('issue', nodeid): {'no... | 34,056 |
def testSetDate(self): self.assertEqual(self.parseForm({'date': '2003-01-01'}), ({('test', None): {'date': date.Date('2003-01-01')}}, [])) nodeid = self.db.test.create(date=date.Date('2003-01-01')) self.assertEqual(self.parseForm({'date': '2003-01-01'}, 'test', nodeid), ({('test', nodeid): {}}, [])) | def testSetDate(self): self.assertEqual(self.parseForm({'date': '2003-01-01'}), ({('test', None): {'date': date.Date('2003-01-01')}}, [])) nodeid = self.db.test.create(date=date.Date('2003-01-01')) self.assertEqual(self.parseForm({'date': '2003-01-01'}, 'test', nodeid), ({('test', nodeid): {}}, [])) | 34,057 |
def testEmptyDateSet(self): nodeid = self.db.test.create(date=date.Date('.')) self.assertEqual(self.parseForm({'date': ''}, 'test', nodeid), ({('test', nodeid): {'date': None}}, [])) nodeid = self.db.test.create(date=date.Date('1970-01-01.00:00:00')) self.assertEqual(self.parseForm({'date': ' '}, 'test', nodeid), ({('t... | def testEmptyDateSet(self): nodeid = self.db.test.create(date=date.Date('.')) self.assertEqual(self.parseForm({'date': ''}, 'test', nodeid), ({('test', nodeid): {'date': None}}, [])) nodeid = self.db.test.create(date=date.Date('1970-01-01.00:00:00')) self.assertEqual(self.parseForm({'date': ' '}, 'test', nodeid), ({('t... | 34,058 |
def testEmptyDateSet(self): nodeid = self.db.test.create(date=date.Date('.')) self.assertEqual(self.parseForm({'date': ''}, 'test', nodeid), ({('test', nodeid): {'date': None}}, [])) nodeid = self.db.test.create(date=date.Date('1970-01-01.00:00:00')) self.assertEqual(self.parseForm({'date': ' '}, 'test', nodeid), ({('t... | def testEmptyDateSet(self): nodeid = self.db.test.create(date=date.Date('.')) self.assertEqual(self.parseForm({'date': ''}, 'test', nodeid), ({('test', nodeid): {'date': None}}, [])) nodeid = self.db.test.create(date=date.Date('1970-01-01.00:00:00')) self.assertEqual(self.parseForm({'date': ' '}, 'test', nodeid), ({('t... | 34,059 |
def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(FormTestCase)) suite.addTest(unittest.makeSuite(MessageTestCase)) return suite | def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(FormTestCase)) suite.addTest(unittest.makeSuite(MessageTestCase)) return suite | 34,060 |
def load_ini(self, config_path, defaults=None): """Set options from config.ini file in given home_dir | def load_ini(self, config_path, defaults=None): """Set options from config.ini file in given home_dir | 34,061 |
def __init__(self, s): rfc822.Message.__init__(self, StringIO(s.strip())) | def __init__(self, s): rfc822.Message.__init__(self, StringIO(s.strip())) | 34,062 |
def __eq__(self, other): return (self.dict == other.dict and self.fp.read() == other.fp.read()) | def __eq__(self, other): return (self.dict == other.dict and self.fp.read() == other.fp.read()) | 34,063 |
def compareMessages(self, new, old): """Compare messages for semantic equivalence.""" new, old = Message(new), Message(old) del new['date'], old['date'] | def compareMessages(self, new, old): """Compare messages for semantic equivalence.""" new, old = Message(new), Message(old) del new['date'], old['date'] | 34,064 |
def setUp(self): MailgwTestCase.count = MailgwTestCase.count + 1 self.dirname = '_test_mailgw_%s'%self.count try: shutil.rmtree(self.dirname) except OSError, error: if error.errno not in (errno.ENOENT, errno.ESRCH): raise # create the instance init.install(self.dirname, 'templates/classic') init.write_select_db(self.di... | def setUp(self): MailgwTestCase.count = MailgwTestCase.count + 1 self.dirname = '_test_mailgw_%s'%self.count try: shutil.rmtree(self.dirname) except OSError, error: if error.errno not in (errno.ENOENT, errno.ESRCH): raise # create the instance init.install(self.dirname, 'templates/classic') init.write_select_db(self.di... | 34,065 |
def _handle_mail(self, message): handler = self.instance.MailGW(self.instance, self.db) handler.trapExceptions = 0 ret = handler.main(StringIO(message)) # handler can close the db on us and open a new one self.db = handler.db return ret | def _handle_mail(self, message): handler = self.instance.MailGW(self.instance, self.db) handler.trapExceptions = 0 ret = handler.main(StringIO(message)) # handler can close the db on us and open a new one self.db = handler.db return ret | 34,066 |
def testAlternateAddress(self): self._handle_mail('''Content-Type: text/plain; | def testAlternateAddress(self): self._handle_mail('''Content-Type: text/plain; | 34,067 |
# def testMultipart(self): | # def testMultipart(self): | 34,068 |
def testContentDisposition(self): self.doNewIssue() self._handle_mail('''Content-Type: text/plain; | def testContentDisposition(self): self.doNewIssue() self._handle_mail('''Content-Type: text/plain; | 34,069 |
def testFollowupOnNonIssue(self): self.db.keyword.create(name='Foo') self._handle_mail('''Content-Type: text/plain; | def testFollowupOnNonIssue(self): self.db.keyword.create(name='Foo') self._handle_mail('''Content-Type: text/plain; | 34,070 |
def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(MailgwTestCase)) return suite | def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(MailgwTestCase)) return suite | 34,071 |
def email(self, escape=1): ''' fudge email ''' if self.value is None: value = '' else: value = str(self._value) value = value.replace('@', ' at ') value = value.replace('.', ' ') if escape: value = cgi.escape(value) return value | def email(self, escape=1): ''' fudge email ''' if self._value is None: value = '' else: value = str(self._value) value = value.replace('@', ' at ') value = value.replace('.', ' ') if escape: value = cgi.escape(value) return value | 34,072 |
def handle_message(self, message): ''' message - a Message instance | def handle_message(self, message): ''' message - a Message instance | 34,073 |
def handle_message(self, message): ''' message - a Message instance | def handle_message(self, message): ''' message - a Message instance | 34,074 |
def handle_message(self, message): ''' message - a Message instance | def handle_message(self, message): ''' message - a Message instance | 34,075 |
def handle_message(self, message): ''' message - a Message instance | def handle_message(self, message): ''' message - a Message instance | 34,076 |
def do_import(self, args): ""'''Usage: import import_dir Import a database from the directory containing CSV files, two per class to import. | def do_import(self, args): ""'''Usage: import import_dir Import a database from the directory containing CSV files, two per class to import. | 34,077 |
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:vV') except getopt.GetoptError, e: self.usage(str(e)) return 1 | 34,078 |
def sql_stringquote(self, value): ''' psycopg.QuotedString returns a "buffer" object with the single-quotes around it... ''' return str(psycopg.QuotedString(str(value)))[1:-1] | def sql_stringquote(self, value): ''' psycopg.QuotedString returns a "buffer" object with the single-quotes around it... ''' return str(psycopg.QuotedString(str(value)))[1:-1] | 34,079 |
def __open(self): ''' Open the metakit database ''' # make the database dir if it doesn't exist if not os.path.exists(self.config.DATABASE): os.makedirs(self.config.DATABASE) | def __open(self): ''' Open the metakit database ''' # make the database dir if it doesn't exist if not os.path.exists(self.config.DATABASE): os.makedirs(self.config.DATABASE) | 34,080 |
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 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] | 34,081 |
propdef = all_propdef[cn] | propdef = all_propdef[cn] | 34,082 |
propdef = all_propdef[cn] | propdef = all_propdef[cn] | 34,083 |
def indexargs_href(self, url, args): ''' embed the current index args in a URL ''' l = ['%s=%s'%(k,v) for k,v in args.items()] if self.columns and not args.has_key(':columns'): l.append(':columns=%s'%(','.join(self.columns))) if self.sort[1] is not None and not args.has_key(':sort'): if self.sort[0] == '-': val = '-'+s... | def indexargs_url(self, url, args): ''' embed the current index args in a URL ''' l = ['%s=%s'%(k,v) for k,v in args.items()] if self.columns and not args.has_key(':columns'): l.append(':columns=%s'%(','.join(self.columns))) if self.sort[1] is not None and not args.has_key(':sort'): if self.sort[0] == '-': val = '-'+se... | 34,084 |
def length(self): self.sequence_length = l = len(self._sequence) return l | def length(self): self.sequence_length = l = len(self._sequence) return l | 34,085 |
def local(self, offset): ''' Return the date/time as a local (timezone offset) date/time. ''' self.view_check() | def local(self, offset): ''' Return the date/time as a local (timezone offset) date/time. ''' self.view_check() | 34,086 |
def __getitem__(self, item): ''' return an HTMLProperty instance ''' #print 'HTMLItem.getitem', (self, item) if item == 'id': return self._nodeid | def __getitem__(self, item): ''' return an HTMLProperty instance ''' #print 'HTMLItem.getitem', (self, item) if item == 'id': return self._nodeid | 34,087 |
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... | 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... | 34,088 |
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... | 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... | 34,089 |
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... | 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... | 34,090 |
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... | 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... | 34,091 |
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>'%(str(etype), str(evalue)), '#ffffff', '#aa55cc',... | 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>'%(str(etype), str(evalue)), '#ffffff', '#aa55cc',... | 34,092 |
def clean(self, now): """Age sessions, remove when they haven't been used for a week. """ week = 60*60*24*7 for sessid in self.list(): interval = now - self.get(sessid, '__timestamp', default=time.time()) if interval > week: self.destroy(sessid) | def clean(self, now): """Age sessions, remove when they haven't been used for a week. """ week = 60*60*24*7 for sessid in self.list(): sess = self.get(sessid, '__timestamp', None) if sess is None: sess=time.time() self.updateTimestamp(sessid) interval = now - sess if interval > week: self.destroy(sessid) | 34,093 |
def serve_static_file(self, file): ''' Serve up the file named from the templates dir ''' filename = os.path.join(self.instance.config.TEMPLATES, file) | def serve_static_file(self, file): ''' Serve up the file named from the templates dir ''' filename = os.path.join(self.instance.config.TEMPLATES, file) | 34,094 |
def indexargs_form(self, columns=1, sort=1, group=1, filter=1, filterspec=1): ''' return the current index args as form elements ''' l = [] sc = self.special_char s = self.input(type="hidden",name="%s",value="%s") if columns and self.columns: l.append(s%(sc+'columns', ','.join(self.columns))) if sort and self.sort[1] i... | def indexargs_form(self, columns=1, sort=1, group=1, filter=1, filterspec=1): ''' return the current index args as form elements ''' l = [] sc = self.special_char s = self.input(type="hidden",name="%s",value="%s") if columns and self.columns: l.append(s%(sc+'columns', ','.join(self.columns))) if sort and self.sort[1] i... | 34,095 |
def indexargs_url(self, url, args): ''' Embed the current index args in a URL ''' sc = self.special_char l = ['%s=%s'%(k,v) for k,v in args.items()] | def indexargs_url(self, url, args): ''' Embed the current index args in a URL ''' sc = self.special_char l = ['%s=%s'%(k,v) for k,v in args.items()] | 34,096 |
def indexargs_url(self, url, args): ''' Embed the current index args in a URL ''' sc = self.special_char l = ['%s=%s'%(k,v) for k,v in args.items()] | def indexargs_url(self, url, args): ''' Embed the current index args in a URL ''' sc = self.special_char l = ['%s=%s'%(k,v) for k,v in args.items()] | 34,097 |
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] | 34,098 |
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] | 34,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.