rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
value = self._value | if value is None: value = self._value | def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form <select> list for this property. | 5b1813e3f3108a95ebc7661eae8787addf7d4e2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/5b1813e3f3108a95ebc7661eae8787addf7d4e2e/templating.py |
authaddr = straddr( ('',authaddr) ) | authaddr = " <%s>" % straddr( ('',authaddr) ) | def send_message(self, nodeid, msgid, note, 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 | ead73ce4bcd111ad77f18bada67a079c960a728b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/ead73ce4bcd111ad77f18bada67a079c960a728b/roundupdb.py |
if nodeid: messages = cl.get(nodeid, 'messages') messages.append(message_id) props['messages'] = messages else: props['messages'] = [message_id] | if nodeid: messages = cl.get(nodeid, 'messages') messages.append(message_id) props['messages'] = messages else: props['messages'] = [message_id] | def handle_message(self, message): ''' message - a Message instance | 04f9a85f8b485d1ff6892371af387c8cb04af8f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/04f9a85f8b485d1ff6892371af387c8cb04af8f5/mailgw.py |
class TemplatingUtil: def __init__(self, utils, callable): self.utils = utils self.callable = callable def __call__(self, *args, **kw): args = (self.utils,)+args return self.callable(*args, **kw) | def next(self): try: self._sequence[self.end] except IndexError: return None return Batch(self.client, self._sequence, self._size, self.end - self.overlap, 0, self.orphan, self.overlap) | 63066f635c3aa76c17def4baf319ee16d063616d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/63066f635c3aa76c17def4baf319ee16d063616d/templating.py | |
return TemplatingUtil(self, self.client.instance.templating_utils[name]) | return self.client.instance.templating_utils[name] | def __getattr__(self, name): '''Try the tracker's templating_utils.''' if not hasattr(self.client.instance, 'templating_utils'): # backwards-compatibility raise AttributeError, name if not self.client.instance.templating_utils.has_key(name): raise AttributeError, name return TemplatingUtil(self, self.client.instance.te... | 63066f635c3aa76c17def4baf319ee16d063616d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/63066f635c3aa76c17def4baf319ee16d063616d/templating.py |
def translation(domain, localedir=None, languages=None, class_=None): | def find_translation(domain, localedir=None, languages=None, class_=None): | def translation(domain, localedir=None, languages=None, class_=None): """Always raise IOError (no message catalogs available)""" raise IOError(errno.ENOENT, "No translation file found for domain", domain) | f273e5051ed346960e0a84c1f1aa4ac3b3142d19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f273e5051ed346960e0a84c1f1aa4ac3b3142d19/i18n.py |
translation = gettext_module.translation | find_translation = gettext_module.translation | def ungettext(self, singular, plural, count): if count == 1: _msg = singular else: _msg = plural return self.ugettext(_msg) | f273e5051ed346960e0a84c1f1aa4ac3b3142d19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f273e5051ed346960e0a84c1f1aa4ac3b3142d19/i18n.py |
translation = gettext_module.translation | find_translation = gettext_module.translation | def ungettext(self, singular, plural, count): if count == 1: _msg = singular else: _msg = plural return self.ugettext(_msg) | f273e5051ed346960e0a84c1f1aa4ac3b3142d19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f273e5051ed346960e0a84c1f1aa4ac3b3142d19/i18n.py |
def get_translation(language=None, domain=DOMAIN): """Return Translation object for given language and domain""" | def get_translation(language=None, domain=DOMAIN, translation_class=RoundupTranslations, null_translation_class=RoundupNullTranslations ): """Return Translation object for given language and domain Arguments 'translation_class' and 'null_translation_class' specify the classes that are instantiated for existing and non... | def get_translation(language=None, domain=DOMAIN): """Return Translation object for given language and domain""" if language: _languages = [language] else: # use OS environment _languages = None # except for english ("en") language, add english fallback if available if language == "en": _fallback = None else: try: _fal... | f273e5051ed346960e0a84c1f1aa4ac3b3142d19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f273e5051ed346960e0a84c1f1aa4ac3b3142d19/i18n.py |
_fallback = translation(domain=domain, languages=["en"], class_=RoundupTranslations) | _fallback = find_translation(domain=domain, languages=["en"], class_=translation_class) | def get_translation(language=None, domain=DOMAIN): """Return Translation object for given language and domain""" if language: _languages = [language] else: # use OS environment _languages = None # except for english ("en") language, add english fallback if available if language == "en": _fallback = None else: try: _fal... | f273e5051ed346960e0a84c1f1aa4ac3b3142d19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f273e5051ed346960e0a84c1f1aa4ac3b3142d19/i18n.py |
_translation = translation(domain=domain, languages=_languages, class_=RoundupTranslations) | _translation = find_translation(domain=domain, languages=_languages, class_=translation_class) | def get_translation(language=None, domain=DOMAIN): """Return Translation object for given language and domain""" if language: _languages = [language] else: # use OS environment _languages = None # except for english ("en") language, add english fallback if available if language == "en": _fallback = None else: try: _fal... | f273e5051ed346960e0a84c1f1aa4ac3b3142d19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f273e5051ed346960e0a84c1f1aa4ac3b3142d19/i18n.py |
_translation = RoundupNullTranslations() | _translation = null_translation_class() | def get_translation(language=None, domain=DOMAIN): """Return Translation object for given language and domain""" if language: _languages = [language] else: # use OS environment _languages = None # except for english ("en") language, add english fallback if available if language == "en": _fallback = None else: try: _fal... | f273e5051ed346960e0a84c1f1aa4ac3b3142d19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f273e5051ed346960e0a84c1f1aa4ac3b3142d19/i18n.py |
def get_translation(language=None, domain=DOMAIN): """Return Translation object for given language and domain""" if language: _languages = [language] else: # use OS environment _languages = None # except for english ("en") language, add english fallback if available if language == "en": _fallback = None else: try: _fal... | f273e5051ed346960e0a84c1f1aa4ac3b3142d19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f273e5051ed346960e0a84c1f1aa4ac3b3142d19/i18n.py | ||
'if NOT "%%_4ver%%" == "" %(python)s -O -c "from %(package)s.scripts.%(module)s import run; run()" %%$\n' 'if "%%_4ver%%" == "" %(python)s -O -c "from %(package)s.scripts.%(module)s import run; run()" %%*\n' | 'if NOT "%%_4ver%%" == "" "%(python)s" -O -c "from %(package)s.scripts.%(module)s import run; run()" %%$\n' 'if "%%_4ver%%" == "" "%(python)s" -O -c "from %(package)s.scripts.%(module)s import run; run()" %%*\n' | def copy_scripts(self): """ Create each script listed in 'self.scripts' """ if not self.package_name: raise Exception("You have to inherit build_scripts_create and" " provide a package name") to_module = string.maketrans('-/', '_.') | f762aa338d95cbed247261cfc56bd8a29ed69593 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f762aa338d95cbed247261cfc56bd8a29ed69593/setup.py |
if len(changed) > 1: plural = 's were' else: plural = ' was' summary = 'This %s has been created through the web.'%cn m.append('\n%s\n'%summary) | m.append('\nThis %s has been created through ' 'the web.\n'%cn) | def newissue(self, message=None): ''' add an issue ''' cn = self.classname cl = self.db.classes[cn] | a8e9d396bbe6e91021f16264c09232ce1c6ab1b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/a8e9d396bbe6e91021f16264c09232ce1c6ab1b9/roundup_cgi.py |
if qids: | if qids and old_queryname: | def handle(self): """Mangle some of the form variables. | cee2a437f8c7ddb9eb495fe6ed7c5e716aaeaa36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/cee2a437f8c7ddb9eb495fe6ed7c5e716aaeaa36/actions.py |
linkvalue = cgi.escape(linkcl.get(value, k)) | linkvalue = cgi.escape(str(linkcl.get(value, k))) | def do_link(self, property=None, is_download=0, showid=0): '''For a Link or Multilink property, display the names of the linked nodes, hyperlinked to the item views on those nodes. For other properties, link to this node with the property as the text. | e8b7b5b7769d5cd83a724b816f0e726ec2fdc8f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e8b7b5b7769d5cd83a724b816f0e726ec2fdc8f4/htmltemplate.py |
linkvalue = cgi.escape(linkcl.get(value, k)) | linkvalue = cgi.escape(str(linkcl.get(value, k))) | def do_link(self, property=None, is_download=0, showid=0): '''For a Link or Multilink property, display the names of the linked nodes, hyperlinked to the item views on those nodes. For other properties, link to this node with the property as the text. | e8b7b5b7769d5cd83a724b816f0e726ec2fdc8f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e8b7b5b7769d5cd83a724b816f0e726ec2fdc8f4/htmltemplate.py |
option = cgi.escape(linkcl.get(optionid, k)) | option = cgi.escape(str(linkcl.get(optionid, k))) | def do_checklist(self, property, **args): ''' for a Link or Multilink property, display checkboxes for the available choices to permit filtering ''' propclass = self.properties[property] if (not isinstance(propclass, hyperdb.Link) and not isinstance(propclass, hyperdb.Multilink)): return _('[Checklist: not a link]') | e8b7b5b7769d5cd83a724b816f0e726ec2fdc8f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/e8b7b5b7769d5cd83a724b816f0e726ec2fdc8f4/htmltemplate.py |
if cl.get(nodeid, entry) is None: | if cl.get(nodeid, entry) is not None: | propdef = all_propdef[cn] | cba5e7bc2ae091d76ffdeb8855c3b7e5f7f0cffa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/cba5e7bc2ae091d76ffdeb8855c3b7e5f7f0cffa/form_parser.py |
def extractUserFromList(users): | def extractUserFromList(userClass, users): | def extractUserFromList(users): '''Given a list of users, try to extract the first non-anonymous user and return that user, otherwise return None ''' if len(users) > 1: # make sure we don't match the anonymous or admin user for user in users: if user == '1': continue if self.user.get(user, 'username') == 'anonymous': c... | ce5cb2d429b48d4e3bd922e92dcb3096de03c96d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/ce5cb2d429b48d4e3bd922e92dcb3096de03c96d/roundupdb.py |
if self.user.get(user, 'username') == 'anonymous': continue | if userClass.get(user, 'username') == 'anonymous': continue | def extractUserFromList(users): '''Given a list of users, try to extract the first non-anonymous user and return that user, otherwise return None ''' if len(users) > 1: # make sure we don't match the anonymous or admin user for user in users: if user == '1': continue if self.user.get(user, 'username') == 'anonymous': c... | ce5cb2d429b48d4e3bd922e92dcb3096de03c96d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/ce5cb2d429b48d4e3bd922e92dcb3096de03c96d/roundupdb.py |
user = extractUserFromList(self.user.stringFind(address=address)) | user = extractUserFromList(self.user, self.user.stringFind(address=address)) | def uidFromAddress(self, address, create=1): ''' address is from the rfc822 module, and therefore is (name, addr) | ce5cb2d429b48d4e3bd922e92dcb3096de03c96d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/ce5cb2d429b48d4e3bd922e92dcb3096de03c96d/roundupdb.py |
user = extractUserFromList(users) | user = extractUserFromList(self.user, users) | def uidFromAddress(self, address, create=1): ''' address is from the rfc822 module, and therefore is (name, addr) | ce5cb2d429b48d4e3bd922e92dcb3096de03c96d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/ce5cb2d429b48d4e3bd922e92dcb3096de03c96d/roundupdb.py |
user = extractUserFromList(self.user.stringFind(username=address)) | user = extractUserFromList(self.user, self.user.stringFind(username=address)) | def uidFromAddress(self, address, create=1): ''' address is from the rfc822 module, and therefore is (name, addr) | ce5cb2d429b48d4e3bd922e92dcb3096de03c96d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/ce5cb2d429b48d4e3bd922e92dcb3096de03c96d/roundupdb.py |
prop = cl.properties[propname] | prop = props[propname] | def generateChangeNote(self, nodeid, oldvalues): """Generate a change note that lists property changes """ cn = self.classname cl = self.db.classes[cn] changed = {} props = cl.getprops(protected=0) | ce5cb2d429b48d4e3bd922e92dcb3096de03c96d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/ce5cb2d429b48d4e3bd922e92dcb3096de03c96d/roundupdb.py |
hal = self.env['HTTP_ACCEPT_LANGUAGE'] | hal = self.env.get('HTTP_ACCEPT_LANGUAGE') | def determine_language(self): """Determine the language""" # look for language parameter # then for language cookie # last for the Accept-Language header if self.form.has_key("@language"): language = self.form["@language"].value if language.lower() == "none": language = "" self.add_cookie("roundup_language", language) ... | 1418f3aa879f5da6b07029069d7c4d014448fdf3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/1418f3aa879f5da6b07029069d7c4d014448fdf3/client.py |
self.assertEqual(keys, ['assignedto', 'deadline', 'files', 'foo', 'messages', 'nosy', 'status', 'superseder', 'title']) self.assertEqual(None,params['deadline']) self.assertEqual(None,params['foo']) self.assertEqual([],params['nosy']) self.assertEqual('1',params['status']) self.assertEqual('spam',params['title']) | self.assertEqual(keys, []) | def testJournals(self): self.db.user.create(username="mary") self.db.user.create(username="pete") self.db.issue.create(title="spam", status='1') self.db.commit() | 8706e2d49920b778337ade491d6af83e64ad7c04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/8706e2d49920b778337ade491d6af83e64ad7c04/test_db.py |
init.write_select_db(self.dirname, 'anydbm') | init.write_select_db(self.dirname, 'sqlite') | 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... | 9667ad9adbe4135e6b6c3a5026d7157b4c3a4383 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/9667ad9adbe4135e6b6c3a5026d7157b4c3a4383/test_mailgw.py |
return handler.main(StringIO(message)) | ret = handler.main(StringIO(message)) self.db = handler.db return ret | def _handle_mail(self, message): handler = self.instance.MailGW(self.instance, self.db) handler.trapExceptions = 0 return handler.main(StringIO(message)) | 9667ad9adbe4135e6b6c3a5026d7157b4c3a4383 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/9667ad9adbe4135e6b6c3a5026d7157b4c3a4383/test_mailgw.py |
if self._db.security.hasPermission('View', self._client.userid, self._classname): return 1 return self.is_edit_ok() | return self._db.security.hasPermission('View', self._client.userid, self._classname) | 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_edit_ok() | d9e80f37f44a2a76c56630995a8af85bbd927ccd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/d9e80f37f44a2a76c56630995a8af85bbd927ccd/templating.py |
If the "form" arg is given, it's passed through to the | If the "form" arg is given, it's passed through to the | def classhelp(self, properties=None, label=''"(list)", width='500', height='400', property='', form='itemSynopsis'): '''Pop up a javascript window with class help | d9e80f37f44a2a76c56630995a8af85bbd927ccd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/d9e80f37f44a2a76c56630995a8af85bbd927ccd/templating.py |
def plain(self, escape=0, hyperlink=1): | def plain(self, escape=0, hyperlink=0): | def plain(self, escape=0, hyperlink=1): ''' 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 = self._value i... | bd536c3f7ed06cd1a236459786f39ea19161a30c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/bd536c3f7ed06cd1a236459786f39ea19161a30c/templating.py |
s = self._value | s = str(self._value) | def plain(self, escape=0, hyperlink=1): ''' 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 = self._value i... | bd536c3f7ed06cd1a236459786f39ea19161a30c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/bd536c3f7ed06cd1a236459786f39ea19161a30c/templating.py |
messages.set(msgid, messageid=messageid) | if msgid is not None: messages.set(msgid, messageid=messageid) | 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 | 639287ccb941d86941d385671ee20795958237e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/639287ccb941d86941d385671ee20795958237e0/roundupdb.py |
for key, value in propvalues.items(): | journalvalues = {} for propname, value in propvalues.items(): | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
if key == self.key and node[key] != value: | if propname == self.key and node[propname] != value: | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
prop = self.properties[key] | prop = self.properties[propname] | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
if node.has_key(key) and value == node[key]: del propvalues[key] | if node.has_key(propname) and value == node[propname]: del propvalues[propname] | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
link_class = self.properties[key].classname | link_class = self.properties[propname].classname | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
key, value, self.properties[key].classname) | propname, value, self.properties[propname].classname) | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
if self.do_journal and self.properties[key].do_journal: | if self.do_journal and self.properties[propname].do_journal: | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
if node[key] is not None: self.db.addjournal(link_class, node[key], 'unlink', (self.classname, nodeid, key)) | if node[propname] is not None: self.db.addjournal(link_class, node[propname], 'unlink', (self.classname, nodeid, propname)) | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
(self.classname, nodeid, key)) | (self.classname, nodeid, propname)) | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
raise TypeError, 'new property "%s" not a list of ids'%key link_class = self.properties[key].classname | raise TypeError, 'new property "%s" not a list of'\ ' ids'%propname link_class = self.properties[propname].classname | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
'must be a string'%key | 'must be a string'%propname | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
key, entry, self.properties[key].classname) | propname, entry, self.properties[propname].classname) | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
propvalues[key] = value | propvalues[propname] = value add = [] remove = [] | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
if node.has_key(key): l = node[key] | if node.has_key(propname): l = node[propname] | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
if self.do_journal and self.properties[key].do_journal: | if self.do_journal and self.properties[propname].do_journal: | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
(self.classname, nodeid, key)) | (self.classname, nodeid, propname)) | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
raise IndexError, '%s has no node %s'%( link_class, id) | raise IndexError, '%s has no node %s'%(link_class, id) | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
if self.do_journal and self.properties[key].do_journal: | if self.do_journal and self.properties[propname].do_journal: | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
(self.classname, nodeid, key)) | (self.classname, nodeid, propname)) | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
raise TypeError, 'new property "%s" not a string'%key | raise TypeError, 'new property "%s" not a string'%propname | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
raise TypeError, 'new property "%s" not a Password'% key propvalues[key] = value | raise TypeError, 'new property "%s" not a Password'%propname propvalues[propname] = value | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
raise TypeError, 'new property "%s" not a Date'% key propvalues[key] = value | raise TypeError, 'new property "%s" not a Date'% propname propvalues[propname] = value | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
raise TypeError, 'new property "%s" not an Interval'% key propvalues[key] = value node[key] = value | raise TypeError, 'new property "%s" not an '\ 'Interval'%propname propvalues[propname] = value node[propname] = value | def set(self, nodeid, **propvalues): """Modify a property on an existing node of this class. 'nodeid' must be the id of an existing node of this class or an IndexError is raised. | 62559ddad3b0c092eb8a0eac0f7eef38649108a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/62559ddad3b0c092eb8a0eac0f7eef38649108a0/back_anydbm.py |
1. figure out who we are, defaulting to the "anonymous" user | 1. look for charset and language preferences, set up user locale see determine_charset, determine_language 2. figure out who we are, defaulting to the "anonymous" user | def inner_main(self): '''Process a request. | 4381ee4898d6957dcf5870cef670761c11e9b531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4381ee4898d6957dcf5870cef670761c11e9b531/client.py |
2. figure out what the request is for - the context | 3. figure out what the request is for - the context | def inner_main(self): '''Process a request. | 4381ee4898d6957dcf5870cef670761c11e9b531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4381ee4898d6957dcf5870cef670761c11e9b531/client.py |
3. handle any requested action (item edit, search, ...) | 4. handle any requested action (item edit, search, ...) | def inner_main(self): '''Process a request. | 4381ee4898d6957dcf5870cef670761c11e9b531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4381ee4898d6957dcf5870cef670761c11e9b531/client.py |
4. render a template, resulting in HTML output | 5. render a template, resulting in HTML output | def inner_main(self): '''Process a request. | 4381ee4898d6957dcf5870cef670761c11e9b531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4381ee4898d6957dcf5870cef670761c11e9b531/client.py |
def determine_charset(self): """Look for client charset in the form parameters or browser cookie. | 4381ee4898d6957dcf5870cef670761c11e9b531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4381ee4898d6957dcf5870cef670761c11e9b531/client.py | ||
''' Determine who the user is ''' | """Determine who the user is""" | def determine_user(self): ''' Determine who the user is ''' # determine the uid to use self.opendb('admin') | 4381ee4898d6957dcf5870cef670761c11e9b531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4381ee4898d6957dcf5870cef670761c11e9b531/client.py |
''' Open the database and set the current user. | """Open the database and set the current user. | def opendb(self, username): ''' Open the database and set the current user. | 4381ee4898d6957dcf5870cef670761c11e9b531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4381ee4898d6957dcf5870cef670761c11e9b531/client.py |
''' | """ | def opendb(self, username): ''' Open the database and set the current user. | 4381ee4898d6957dcf5870cef670761c11e9b531 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4381ee4898d6957dcf5870cef670761c11e9b531/client.py |
def __openseen(self, ttype, tstring, lineno): if ttype == tokenize.OP and tstring == ')': # We've seen the last of the translatable strings. Record the # line number of the first line of the strings and update the list # of messages seen. Reset state for the next batch. If there # were no strings inside _(), then ju... | 3f306901313e2911eb63c8a61db313759f99f045 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3f306901313e2911eb63c8a61db313759f99f045/pygettext.py | ||
'value "%(value)s" not a designator') % locals() | 'value "%(entry)s" not a designator') % locals() | propdef = all_propdef[cn] | b1839df4ce32a8cf481803208bfee80bd3fac21a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b1839df4ce32a8cf481803208bfee80bd3fac21a/form_parser.py |
path = os.path.join(os.getcwd(), self.dir, 'nodes.%s'%classname) db_type = whichdb.whichdb(path) if not db_type: db_type = whichdb.whichdb(path+'.db') db_type = whichdb.whichdb(path) if not db_type and os.path.exists(path) or os.path.exists(path+'.db'): raise hyperdb.DatabaseError, \ "Couldn't identify the database ... | db_type = '' path = os.path.join(os.getcwd(), self.dir, name) if os.path.exists(path): db_type = whichdb.whichdb(path) if not db_type: raise hyperdb.DatabaseError, "Couldn't identify database type" elif os.path.exists(path+'.db'): db_type = 'dbm' | def getclassdb(self, classname, mode='r'): ''' grab a connection to the class db that will be used for multiple actions ''' # determine which DB wrote the class file path = os.path.join(os.getcwd(), self.dir, 'nodes.%s'%classname) db_type = whichdb.whichdb(path) if not db_type: # dbm appends ".db" db_type = whichdb.whi... | cdcc95291c36576dd9ab369f2e2e949fd9f4fe8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/cdcc95291c36576dd9ab369f2e2e949fd9f4fe8e/back_anydbm.py |
except: | except ImportError: | def getclassdb(self, classname, mode='r'): ''' grab a connection to the class db that will be used for multiple actions ''' # determine which DB wrote the class file path = os.path.join(os.getcwd(), self.dir, 'nodes.%s'%classname) db_type = whichdb.whichdb(path) if not db_type: # dbm appends ".db" db_type = whichdb.whi... | cdcc95291c36576dd9ab369f2e2e949fd9f4fe8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/cdcc95291c36576dd9ab369f2e2e949fd9f4fe8e/back_anydbm.py |
db = anydbm.open(os.path.join(self.dir, 'journals.%s'%classname), 'r') except anydbm.open, error: if error.args[0] != 2: raise | db = self._opendb('journals.%s'%classname, 'r') except anydbm.error, error: if str(error) == "need 'c' or 'n' flag to open new db": return [] elif error.args[0] != 2: raise | def getjournal(self, classname, nodeid): ''' get the journal for id ''' # attempt to open the journal - in some rare cases, the journal may # not exist try: db = anydbm.open(os.path.join(self.dir, 'journals.%s'%classname), 'r') except anydbm.open, error: if error.args[0] != 2: raise return [] journal = marshal.loads(db... | cdcc95291c36576dd9ab369f2e2e949fd9f4fe8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/cdcc95291c36576dd9ab369f2e2e949fd9f4fe8e/back_anydbm.py |
pass | delimiter = ':' | def writerows(self, rows): for fields in rows: print >>self.fileobj, self.p.join(fields) | 3d83fdb8cfa8c79be20f94178f7d8d15f42187f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3d83fdb8cfa8c79be20f94178f7d8d15f42187f6/rcsv.py |
body.write('\n'.join(error)) | body.write(quopri.encodestring ('\n'.join(error))) | def bounce_message(self, bounced_message, to, error, subject='Failed issue tracker submission'): """Bounce a message, attaching the failed submission. | dcd48e6e553797c68e93bf69fd128157130ef74d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/dcd48e6e553797c68e93bf69fd128157130ef74d/mailer.py |
r'\s*(P<quote>")?(\[(?P<classname>[^\d\s]+)(?P<nodeid>\d+)?\])?' | r'\s*(?P<quote>")?(\[(?P<classname>[^\d\s]+)(?P<nodeid>\d+)?\])?' | 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)... | 484daa710b73ad7f69136c01f27c116b07ed1c8e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/484daa710b73ad7f69136c01f27c116b07ed1c8e/mailgw.py |
if is_sqlite3: | if sqlite_version in (2,3): | def db_nuke(config): shutil.rmtree(config.DATABASE) | 3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79/back_sqlite.py |
if is_sqlite3: conn = sqlite.connect(db, 30) conn.row_factory = sqlite.Row else: | if sqlite_version == 1: | def sql_open_connection(self): '''Open a standard, non-autocommitting connection. | 3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79/back_sqlite.py |
if is_sqlite3: | if sqlite_version in (2,3): | def update_class(self, spec, old_spec, force=0, adding_v2=0): ''' Determine the differences between the current spec and the database version of the spec, and update where necessary. | 3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79/back_sqlite.py |
elif is_sqlite3: | elif sqlite_version in (2,3): | def update_class(self, spec, old_spec, force=0, adding_v2=0): ''' Determine the differences between the current spec and the database version of the spec, and update where necessary. | 3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79/back_sqlite.py |
elif (not is_sqlite3 and entry.has_key(name)): | elif (sqlite_version == 1 and entry.has_key(name)): | def update_class(self, spec, old_spec, force=0, adding_v2=0): ''' Determine the differences between the current spec and the database version of the spec, and update where necessary. | 3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79/back_sqlite.py |
if is_sqlite3: | if sqlite_version in (2,3): | def create_class(self, spec): rdbms_common.Database.create_class(self, spec) sql = 'insert into ids (name, num) values (%s, %s)'%(self.arg, self.arg) vals = (spec.classname, 1) self.sql(sql, vals) | 3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/3aea804e6e4a305eb0f1130505a0a0ffe7ce0e79/back_sqlite.py |
Try: | try: | def handle_message(self, message): ''' message - a Message instance | 338383ee6b65b5dc64411e4689652e526e7faa34 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/338383ee6b65b5dc64411e4689652e526e7faa34/mailgw.py |
def setrruleset(self, rruleset): - dtstart = self.dtstart.value | + @classmethod + def duplicate(clz, copyit): + newcopy = clz() + newcopy.copy(copyit) + return newcopy + + def copy(self, copyit): + super(Component, self).copy(copyit) | def setrruleset(self, rruleset): | 2564f8f84ae753e253fc67a98b3a17e26e4959be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2028/2564f8f84ae753e253fc67a98b3a17e26e4959be/patch-src-vobject-base.py |
+ + try: + dtstart = self.dtstart.value + except AttributeError, KeyError: + if self.name == "VTODO": + dtstart = self.due.value + else: + raise + isDate = datetime.date == type(dtstart) if isDate: dtstart = datetime.datetime(dtstart.year,dtst... | + + self.contents = {} + for key, lvalue in copyit.contents.items(): + newvalue = [] + for value in lvalue: + newitem = value.duplicate(value) + newvalue.append(newitem) + self.contents[key] = newvalue + + self.name = copyit.name + ... | def setrruleset(self, rruleset): | 2564f8f84ae753e253fc67a98b3a17e26e4959be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2028/2564f8f84ae753e253fc67a98b3a17e26e4959be/patch-src-vobject-base.py |
def get_flags_debug(self): @@ -216,7 +216,7 @@ - for fc_exe in map(find_executable,['gfortran','f95']): + for fc_exe in map(find_executable,['gfortran-dp-4.0','f95']): if os.path.isfile(fc_exe): break executables = { | if os.path.join(sys.prefix, 'lib') not in default_lib_dirs: | def get_flags_debug(self): | 0604d588f88244e8ef75ac4005b45c6f28b538b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2028/0604d588f88244e8ef75ac4005b45c6f28b538b9/patch-system_info.py |
logStats = os.stat(self.logPath) | self.logStats = os.stat(self.logPath) | def isModified(self): """ Checks if the log file has been modified using os.stat(). """ try: logStats = os.stat(self.logPath) except OSError: self.logSys.error("Unable to get stat on "+self.logPath) sys.exit(-1) if self.lastModTime == logStats.st_mtime: return False else: self.logSys.debug(self.logPath+" has been modi... | 064ef28dc45fe8e09a8e3dd8833516dc9cfa9868 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/064ef28dc45fe8e09a8e3dd8833516dc9cfa9868/logreader.py |
if self.lastModTime == logStats.st_mtime: | if self.lastModTime == self.logStats.st_mtime: | def isModified(self): """ Checks if the log file has been modified using os.stat(). """ try: logStats = os.stat(self.logPath) except OSError: self.logSys.error("Unable to get stat on "+self.logPath) sys.exit(-1) if self.lastModTime == logStats.st_mtime: return False else: self.logSys.debug(self.logPath+" has been modi... | 064ef28dc45fe8e09a8e3dd8833516dc9cfa9868 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/064ef28dc45fe8e09a8e3dd8833516dc9cfa9868/logreader.py |
self.lastModTime = logStats.st_mtime | self.lastModTime = self.logStats.st_mtime | def isModified(self): """ Checks if the log file has been modified using os.stat(). """ try: logStats = os.stat(self.logPath) except OSError: self.logSys.error("Unable to get stat on "+self.logPath) sys.exit(-1) if self.lastModTime == logStats.st_mtime: return False else: self.logSys.debug(self.logPath+" has been modi... | 064ef28dc45fe8e09a8e3dd8833516dc9cfa9868 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/064ef28dc45fe8e09a8e3dd8833516dc9cfa9868/logreader.py |
self.logSys.debug("Setting file position to " + `self.lastPos`) logFile.seek(self.lastPos) | self.setFilePos(logFile) | def getFailures(self): """ Gets all the failure in the log file which are newer than time.time()-self.findTime. Returns a dict with the IP, the number of failure and the latest failure time. """ ipList = dict() logFile = self.openLogFile() self.logSys.debug("Setting file position to " + `self.lastPos`) logFile.seek(se... | 064ef28dc45fe8e09a8e3dd8833516dc9cfa9868 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/064ef28dc45fe8e09a8e3dd8833516dc9cfa9868/logreader.py |
Thanks to Kvin Drapel. | Thanks to Kevin Drapel. | def dnsToIp(dns): """ Convert a DNS into an IP address using the Python socket module. Thanks to Kvin Drapel. """ try: return socket.gethostbyname_ex(dns)[2] except socket.gaierror: return list() | c442955e30ac29fa29d11156ecf3208c3961690a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/c442955e30ac29fa29d11156ecf3208c3961690a/dns.py |
else: | if not ipList: | def textToIp(text): """ Return the IP of DNS found in a given text. """ ipList = list() # Search for plain IP plainIP = searchIP(text) for element in plainIP: ipList.append(element) else: # Try to get IP from possible DNS dnsList = textToDns(text) for element in dnsList: dns = dnsToIp(element) for e in dns: ipList.appe... | c442955e30ac29fa29d11156ecf3208c3961690a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/c442955e30ac29fa29d11156ecf3208c3961690a/dns.py |
print socket.gethostbyname_ex("www.google")[2] | print socket.gethostbyname_ex("195.122.223.30")[2] | def textToIp(text): """ Return the IP of DNS found in a given text. """ ipList = list() # Search for plain IP plainIP = searchIP(text) for element in plainIP: ipList.append(element) else: # Try to get IP from possible DNS dnsList = textToDns(text) for element in dnsList: dns = dnsToIp(element) for e in dns: ipList.appe... | c442955e30ac29fa29d11156ecf3208c3961690a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/c442955e30ac29fa29d11156ecf3208c3961690a/dns.py |
def textToIp(text): """ Return the IP of DNS found in a given text. """ ipList = list() # Search for plain IP plainIP = searchIP(text) for element in plainIP: ipList.append(element) else: # Try to get IP from possible DNS dnsList = textToDns(text) for element in dnsList: dns = dnsToIp(element) for e in dns: ipList.appe... | c442955e30ac29fa29d11156ecf3208c3961690a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/c442955e30ac29fa29d11156ecf3208c3961690a/dns.py | ||
@staticmethod | @staticmethod | def __processCmd(self, cmd, aInfo = None): """ Executes an OS command. """ if cmd == "": logSys.debug("Nothing to do") return True checkCmd = Action.replaceTag(self.__actionCheck, self.__cInfo) if not Action.executeCmd(checkCmd): logSys.error("Invariant check failed. Trying to restore a sane" + " environment") stopCmd... | 4536ddbcc10020790a6c203e8da8f91c6b774c2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/4536ddbcc10020790a6c203e8da8f91c6b774c2c/action.py |
self.server.start() | self.server.start(False) | def setUp(self): """Call before every test case.""" self.server = Server() self.server.setLogLevel(0) self.server.start() | 0326a9415717bc0500c94f99051c724e9b98c16b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/0326a9415717bc0500c94f99051c724e9b98c16b/servertestcase.py |
self.server.start() | self.server.start(False) | def setUp(self): """Call before every test case.""" self.server = Server() self.server.setLogLevel(0) self.server.start() | 0326a9415717bc0500c94f99051c724e9b98c16b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/0326a9415717bc0500c94f99051c724e9b98c16b/servertestcase.py |
stream.append(["set", self.__name, "addignoreip", self.__opts[opt]]) | for ip in self.__opts[opt].split(): stream.append(["set", self.__name, "addignoreip", ip]) | def convert(self): stream = [] for opt in self.__opts: if opt == "logpath": for path in self.__opts[opt].split("\n"): pathList = glob.glob(path) if len(pathList) == 0: logSys.error("No file found for " + path) for p in pathList: stream.append(["set", self.__name, "addlogpath", p]) elif opt == "backend": backend = self.... | dad43027d3d041f4205c29582cd7fe0b21597f56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/dad43027d3d041f4205c29582cd7fe0b21597f56/jailreader.py |
self.__socket.join() | while self.__socket.isAlive(): self.__socket.join(1) | def start(self, sock, force = False): logSys.info("Starting Fail2ban") # First set the mask to only allow access to owner os.umask(0077) if self.__daemon: ret = self.__createDaemon() if ret: logSys.info("Daemon started") else: logSys.error("Could not create daemon") raise ServerInitializationError("Could not create dae... | ae0ed204eecfeb28d58f16a513d2efa40c9aa411 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/ae0ed204eecfeb28d58f16a513d2efa40c9aa411/server.py |
logSys.warn("[%s] Ban %s" % (self.jail.getName(), aInfo["ip"])) for action in self.__actions: action.execActionBan(aInfo) self.__banManager.addBanTicket(bTicket) return True | aInfo["time"] = bTicket.getTime() if self.__banManager.addBanTicket(bTicket): logSys.warn("[%s] Ban %s" % (self.jail.getName(), aInfo["ip"])) for action in self.__actions: action.execActionBan(aInfo) return True else: logSys.warn("[%s] %s already banned" % (self.jail.getName(), aInfo["ip"])) | def __checkBan(self): ticket = self.jail.getFailTicket() if ticket != False: aInfo = dict() bTicket = BanManager.createBanTicket(ticket) aInfo["ip"] = bTicket.getIP() aInfo["failures"] = bTicket.getAttempt() logSys.warn("[%s] Ban %s" % (self.jail.getName(), aInfo["ip"])) for action in self.__actions: action.execActionB... | d6e49f8480bb8021661d976c82a21c44e10c39da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/d6e49f8480bb8021661d976c82a21c44e10c39da/actions.py |
aInfo = dict() aInfo["ip"] = ticket.getIP() logSys.warn("[%s] Unban %s" % (self.jail.getName(), aInfo["ip"])) for action in self.__actions: action.execActionUnban(aInfo) | self.__unBan(ticket) | def __checkUnBan(self): for ticket in self.__banManager.unBanList(MyTime.time()): aInfo = dict() aInfo["ip"] = ticket.getIP() logSys.warn("[%s] Unban %s" % (self.jail.getName(), aInfo["ip"])) for action in self.__actions: action.execActionUnban(aInfo) | d6e49f8480bb8021661d976c82a21c44e10c39da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/d6e49f8480bb8021661d976c82a21c44e10c39da/actions.py |
aInfo = dict() aInfo["ip"] = ticket.getIP() logSys.warn("[%s] Unban %s" % (self.jail.getName(), aInfo["ip"])) for action in self.__actions: action.execActionUnban(aInfo) | self.__unBan(ticket) def __unBan(self, ticket): aInfo = dict() aInfo["ip"] = ticket.getIP() aInfo["failures"] = ticket.getAttempt() aInfo["time"] = ticket.getTime() logSys.warn("[%s] Unban %s" % (self.jail.getName(), aInfo["ip"])) for action in self.__actions: action.execActionUnban(aInfo) | def __flushBan(self): logSys.debug("Flush ban list") for ticket in self.__banManager.flushBanList(): aInfo = dict() aInfo["ip"] = ticket.getIP() logSys.warn("[%s] Unban %s" % (self.jail.getName(), aInfo["ip"])) for action in self.__actions: action.execActionUnban(aInfo) | d6e49f8480bb8021661d976c82a21c44e10c39da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/d6e49f8480bb8021661d976c82a21c44e10c39da/actions.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.