bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form <select> list for this property. | def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form <select> list for this property. | 34,300 |
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 | 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 | 34,301 |
def handle_message(self, message): ''' message - a Message instance | def handle_message(self, message): ''' message - a Message instance | 34,302 |
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) | 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) | 34,303 |
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... | 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... | 34,304 |
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) | def find_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) | 34,305 |
def ungettext(self, singular, plural, count): if count == 1: _msg = singular else: _msg = plural return self.ugettext(_msg) | def ungettext(self, singular, plural, count): if count == 1: _msg = singular else: _msg = plural return self.ugettext(_msg) | 34,306 |
def ungettext(self, singular, plural, count): if count == 1: _msg = singular else: _msg = plural return self.ugettext(_msg) | def ungettext(self, singular, plural, count): if count == 1: _msg = singular else: _msg = plural return self.ugettext(_msg) | 34,307 |
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... | 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... | 34,308 |
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... | 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... | 34,309 |
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... | 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... | 34,310 |
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... | 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... | 34,311 |
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... | 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... | 34,312 |
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('-/', '_.') | 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('-/', '_.') | 34,313 |
def newissue(self, message=None): ''' add an issue ''' cn = self.classname cl = self.db.classes[cn] | def newissue(self, message=None): ''' add an issue ''' cn = self.classname cl = self.db.classes[cn] | 34,314 |
def handle(self): """Mangle some of the form variables. | def handle(self): """Mangle some of the form variables. | 34,315 |
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. | 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. | 34,316 |
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. | 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. | 34,317 |
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]') | 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]') | 34,318 |
propdef = all_propdef[cn] | propdef = all_propdef[cn] | 34,319 |
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... | def extractUserFromList(userClass, 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') == 'an... | 34,320 |
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... | 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 userClass.get(user, 'username') == 'anonymous': c... | 34,321 |
def uidFromAddress(self, address, create=1): ''' address is from the rfc822 module, and therefore is (name, addr) | def uidFromAddress(self, address, create=1): ''' address is from the rfc822 module, and therefore is (name, addr) | 34,322 |
def uidFromAddress(self, address, create=1): ''' address is from the rfc822 module, and therefore is (name, addr) | def uidFromAddress(self, address, create=1): ''' address is from the rfc822 module, and therefore is (name, addr) | 34,323 |
def uidFromAddress(self, address, create=1): ''' address is from the rfc822 module, and therefore is (name, addr) | def uidFromAddress(self, address, create=1): ''' address is from the rfc822 module, and therefore is (name, addr) | 34,324 |
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) | 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) | 34,325 |
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) ... | 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) ... | 34,326 |
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() | 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() | 34,327 |
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,328 |
def _handle_mail(self, message): handler = self.instance.MailGW(self.instance, self.db) handler.trapExceptions = 0 return handler.main(StringIO(message)) | def _handle_mail(self, message): handler = self.instance.MailGW(self.instance, self.db) handler.trapExceptions = 0 ret = handler.main(StringIO(message)) self.db = handler.db return ret | 34,329 |
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() | 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() | 34,330 |
def classhelp(self, properties=None, label=''"(list)", width='500', height='400', property='', form='itemSynopsis'): '''Pop up a javascript window with class help | def classhelp(self, properties=None, label=''"(list)", width='500', height='400', property='', form='itemSynopsis'): '''Pop up a javascript window with class help | 34,331 |
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... | 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 = self._value i... | 34,332 |
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... | 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 = str(self._val... | 34,333 |
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 | 34,334 |
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. | 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. | 34,335 |
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. | 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. | 34,336 |
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. | 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. | 34,337 |
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. | 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. | 34,338 |
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. | 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. | 34,339 |
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. | 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. | 34,340 |
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. | 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. | 34,341 |
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. | 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. | 34,342 |
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. | 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. | 34,343 |
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. | 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. | 34,344 |
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. | 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. | 34,345 |
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. | 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. | 34,346 |
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. | 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. | 34,347 |
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. | 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. | 34,348 |
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. | 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. | 34,349 |
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. | 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. | 34,350 |
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. | 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. | 34,351 |
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. | 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. | 34,352 |
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. | 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. | 34,353 |
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. | 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. | 34,354 |
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. | 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. | 34,355 |
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. | 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. | 34,356 |
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. | 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. | 34,357 |
def inner_main(self): '''Process a request. | def inner_main(self): '''Process a request. | 34,358 |
def inner_main(self): '''Process a request. | def inner_main(self): '''Process a request. | 34,359 |
def inner_main(self): '''Process a request. | def inner_main(self): '''Process a request. | 34,360 |
def inner_main(self): '''Process a request. | def inner_main(self): '''Process a request. | 34,361 |
def determine_charset(self): """Look for client charset in the form parameters or browser cookie. | defdetermine_charset(self):"""Lookforclientcharsetintheformparametersorbrowsercookie. | 34,362 |
def determine_user(self): ''' Determine who the user is ''' # determine the uid to use self.opendb('admin') | def determine_user(self): """Determine who the user is""" # determine the uid to use self.opendb('admin') | 34,363 |
def opendb(self, username): ''' Open the database and set the current user. | def opendb(self, username): ''' Open the database and set the current user. | 34,364 |
def opendb(self, username): ''' Open the database and set the current user. | def opendb(self, username): """ Open the database and set the current user. | 34,365 |
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... | 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... | 34,366 |
propdef = all_propdef[cn] | propdef = all_propdef[cn] | 34,367 |
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... | 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... | 34,368 |
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... | 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... | 34,369 |
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... | 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 = 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] !=... | 34,370 |
def writerows(self, rows): for fields in rows: print >>self.fileobj, self.p.join(fields) | def writerows(self, rows): for fields in rows: print >>self.fileobj, self.p.join(fields) | 34,371 |
def bounce_message(self, bounced_message, to, error, subject='Failed issue tracker submission'): """Bounce a message, attaching the failed submission. | def bounce_message(self, bounced_message, to, error, subject='Failed issue tracker submission'): """Bounce a message, attaching the failed submission. | 34,372 |
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)... | 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)... | 34,373 |
def db_nuke(config): shutil.rmtree(config.DATABASE) | def db_nuke(config): shutil.rmtree(config.DATABASE) | 34,374 |
def sql_open_connection(self): '''Open a standard, non-autocommitting connection. | def sql_open_connection(self): '''Open a standard, non-autocommitting connection. | 34,375 |
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. | 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. | 34,376 |
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. | 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. | 34,377 |
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. | 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. | 34,378 |
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) | 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) | 34,379 |
def handle_message(self, message): ''' message - a Message instance | def handle_message(self, message): ''' message - a Message instance | 34,380 |
def setrruleset(self, rruleset): | def setrruleset(self, rruleset): | 34,381 |
def setrruleset(self, rruleset): | def setrruleset(self, rruleset): | 34,382 |
def get_flags_debug(self): | def get_flags_debug(self): | 34,383 |
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... | def isModified(self): """ Checks if the log file has been modified using os.stat(). """ try: self.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... | 34,384 |
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... | 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 == self.logStats.st_mtime: return False else: self.logSys.debug(self.logPath+" has been... | 34,385 |
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... | 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... | 34,386 |
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... | 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.setFilePos(logFile) for line in logFile.readlines(): failList = self.findF... | 34,387 |
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() | def dnsToIp(dns): """ Convert a DNS into an IP address using the Python socket module. Thanks to Kevin Drapel. """ try: return socket.gethostbyname_ex(dns)[2] except socket.gaierror: return list() | 34,388 |
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... | 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) if not ipList: # Try to get IP from possible DNS dnsList = textToDns(text) for element in dnsList: dns = dnsToIp(element) for e in dns: ip... | 34,389 |
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... | 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... | 34,390 |
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... | 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... | 34,391 |
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... | 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... | 34,392 |
def setUp(self): """Call before every test case.""" self.server = Server() self.server.setLogLevel(0) self.server.start() | def setUp(self): """Call before every test case.""" self.server = Server() self.server.setLogLevel(0) self.server.start() | 34,393 |
def setUp(self): """Call before every test case.""" self.server = Server() self.server.setLogLevel(0) self.server.start() | def setUp(self): """Call before every test case.""" self.server = Server() self.server.setLogLevel(0) self.server.start() | 34,394 |
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.... | 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.... | 34,395 |
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... | 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... | 34,396 |
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... | def __checkBan(self): ticket = self.jail.getFailTicket() if ticket != False: aInfo = dict() bTicket = BanManager.createBanTicket(ticket) aInfo["ip"] = bTicket.getIP() aInfo["failures"] = bTicket.getAttempt() aInfo["time"] = bTicket.getTime() if self.__banManager.addBanTicket(bTicket): logSys.warn("[%s] Ban %s" % (self.... | 34,397 |
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) | def __checkUnBan(self): for ticket in self.__banManager.unBanList(MyTime.time()): self.__unBan(ticket) | 34,398 |
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) | def __flushBan(self): logSys.debug("Flush ban list") for ticket in self.__banManager.flushBanList(): 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.getNam... | 34,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.