bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def __init__(self, banTime, verbose = False): self.banTime = banTime self.verbose = verbose | def __init__(self, banTime, logSys): self.banTime = banTime self.verbose = verbose | 34,400 |
def __init__(self, banTime, verbose = False): self.banTime = banTime self.verbose = verbose | def __init__(self, banTime, verbose = False): self.banTime = banTime self.logSys = logSys | 34,401 |
def addBanIP(self, ip): if not self.inBanList(ip): self.banList[ip] = time.time() self.executeCmd(self.banIP(ip)) else: if self.verbose: print ip, "already in ban list" | def addBanIP(self, ip, debug): if not self.inBanList(ip): self.banList[ip] = time.time() self.executeCmd(self.banIP(ip)) else: if self.verbose: print ip, "already in ban list" | 34,402 |
def addBanIP(self, ip): if not self.inBanList(ip): self.banList[ip] = time.time() self.executeCmd(self.banIP(ip)) else: if self.verbose: print ip, "already in ban list" | def addBanIP(self, ip): if not self.inBanList(ip): self.banList[ip] = time.time() self.executeCmd(self.banIP(ip), debug) else: if self.verbose: print ip, "already in ban list" | 34,403 |
def addBanIP(self, ip): if not self.inBanList(ip): self.banList[ip] = time.time() self.executeCmd(self.banIP(ip)) else: if self.verbose: print ip, "already in ban list" | def addBanIP(self, ip): if not self.inBanList(ip): self.banList[ip] = time.time() self.executeCmd(self.banIP(ip)) else: self.logSys.info(ip+" already in ban list") | 34,404 |
def delBanIP(self, ip): if self.inBanList(ip): del self.banList[ip] self.executeCmd(self.unBanIP(ip)) else: if self.verbose: print ip, "not in ban list" | def delBanIP(self, ip, debug): if self.inBanList(ip): del self.banList[ip] self.executeCmd(self.unBanIP(ip)) else: if self.verbose: print ip, "not in ban list" | 34,405 |
def delBanIP(self, ip): if self.inBanList(ip): del self.banList[ip] self.executeCmd(self.unBanIP(ip)) else: if self.verbose: print ip, "not in ban list" | def delBanIP(self, ip): if self.inBanList(ip): del self.banList[ip] self.executeCmd(self.unBanIP(ip), debug) else: if self.verbose: print ip, "not in ban list" | 34,406 |
def delBanIP(self, ip): if self.inBanList(ip): del self.banList[ip] self.executeCmd(self.unBanIP(ip)) else: if self.verbose: print ip, "not in ban list" | def delBanIP(self, ip): if self.inBanList(ip): del self.banList[ip] self.executeCmd(self.unBanIP(ip)) else: self.logSys.info(ip+" not in ban list") | 34,407 |
def checkForUnBan(self): """ Check for user to remove from ban list. """ banListTemp = self.banList.copy() iterBanList = banListTemp.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] btime = element[1] if btime < time.time()-self.banTime: self.delBanIP(ip) if self.verbose: prin... | def checkForUnBan(self, debug): """ Check for user to remove from ban list. """ banListTemp = self.banList.copy() iterBanList = banListTemp.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] btime = element[1] if btime < time.time()-self.banTime: self.delBanIP(ip) if self.verbos... | 34,408 |
def checkForUnBan(self): """ Check for user to remove from ban list. """ banListTemp = self.banList.copy() iterBanList = banListTemp.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] btime = element[1] if btime < time.time()-self.banTime: self.delBanIP(ip) if self.verbose: prin... | def checkForUnBan(self): """ Check for user to remove from ban list. """ banListTemp = self.banList.copy() iterBanList = banListTemp.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] btime = element[1] if btime < time.time()-self.banTime: self.delBanIP(ip, debug) | 34,409 |
def flushBanList(self): iterBanList = self.banList.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] self.delBanIP(ip) | def flushBanList(self, debug): iterBanList = self.banList.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] self.delBanIP(ip) | 34,410 |
def flushBanList(self): iterBanList = self.banList.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] self.delBanIP(ip) | def flushBanList(self): iterBanList = self.banList.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] self.delBanIP(ip, debug) | 34,411 |
def executeCmd(self, cmd): if self.verbose: print cmd return #os.system(cmd) | def executeCmd(self, cmd, debug): self.logSys.debug(cmd) if not debug: return os.system(cmd) else: return None #os.system(cmd) | 34,412 |
def checkForPID(lockfile): """ Checks for running Fail2Ban. Returns the current PID if Fail2Ban is running or False if no instance found. """ try: fileHandler = open(lockfile) pid = fileHandler.readline() return pid except IOError: fileHandler = open(lockfile, mode='w') pid = os.getpid() fileHandler.write(`pid`+'\n') ... | def checkForPID(lockfile): """ Checks for running Fail2Ban. Returns the current PID if Fail2Ban is running or False if no instance found. """ try: fileHandler = open(lockfile) pid = fileHandler.readline() return pid except IOError: return False | 34,413 |
def textToDns(text): """ Search for possible DNS in an arbitrary text. """ match = re.findall("\w*\.\w*\.\w*", text) if match: return match else: return None | def textToDns(text): """ Search for possible DNS in an arbitrary text. """ match = re.findall("\w*\.\w*\.\w*", text) if match: return match else: return [] | 34,414 |
def searchIP(text): """ Search if an IP address if directly available and return it. """ match = re.findall("(?:\d{1,3}\.){3}\d{1,3}", text) if match: return match else: return None | def searchIP(text): """ Search if an IP address if directly available and return it. """ match = re.findall("(?:\d{1,3}\.){3}\d{1,3}", text) if match: return match else: return [] | 34,415 |
def textToIp(text): """ Return the IP of DNS found in a given text. """ ipList = list() # Search for plain IP plainIP = searchIP(text) if plainIP: 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:... | 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,416 |
def textToDns(text): """ Search for possible DNS in an arbitrary text. """ match = re.findall("\w*\.\w*\.\w*", text) if match: return match else: return [] | def textToDns(text): """ Search for possible DNS in an arbitrary text. """ match = re.findall("\S*\.\w*\.\w*", text) if match: return match else: return [] | 34,417 |
def read(self, filename): global basedir basename = basedir + filename logSys.debug("Reading " + basename) bConf = basename + ".conf" bLocal = basename + ".local" if os.path.exists(bConf) or os.path.exists(bLocal): SafeConfigParser.read(self, [bConf, bLocal]) return True else: logSys.error(bConf + " and " + bLocal + " ... | def read(self, FILENAME): global basedir basename = basedir + filename logSys.debug("Reading " + basename) bConf = basename + ".conf" bLocal = basename + ".local" if os.path.exists(bConf) or os.path.exists(bLocal): SafeConfigParser.read(self, [bConf, bLocal]) return True else: logSys.error(bConf + " and " + bLocal + " ... | 34,418 |
def setFilePos(self, file): """ Sets the file position. We must take care of log file rotation and reset the position to 0 in that case. Use the log message timestamp in order to detect this. """ line = file.readline() if self.lastDate < self.getTime(line): self.logSys.debug("Date " + `self.lastDate` + " is " + "smalle... | def setFilePos(self, file): """ Sets the file position. We must take care of log file rotation and reset the position to 0 in that case. Use the log message timestamp in order to detect this. """ line = file.readline() if self.lastDate < self.getTime(line): self.logSys.debug("Date " + `self.lastDate` + " is " + "smalle... | 34,419 |
def setFilePos(self, file): """ Sets the file position. We must take care of log file rotation and reset the position to 0 in that case. Use the log message timestamp in order to detect this. """ line = file.readline() if self.lastDate < self.getTime(line): self.logSys.debug("Date " + `self.lastDate` + " is " + "smalle... | def setFilePos(self, file): """ Sets the file position. We must take care of log file rotation and reset the position to 0 in that case. Use the log message timestamp in order to detect this. """ line = file.readline() if self.lastDate < self.getTime(line): self.logSys.debug("Date " + `self.lastDate` + " is " + "smalle... | 34,420 |
def flushBanList(self, debug): """ Flushes the ban list and of course the firewall rules. Called when fail2ban exits. """ iterBanList = self.banList.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] self.delBanIP(ip, debug) | def flushBanList(self, debug): """ Flushes the ban list and of course the firewall rules. Called when fail2ban exits. """ banListTemp = self.banList.copy() iterBanList = banListTemp.iteritems() for i in range(len(self.banList)): element = iterBanList.next() ip = element[0] self.delBanIP(ip, debug) | 34,421 |
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.execActionBan... | 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... | 34,422 |
def __checkUnBan(self): for ticket in self.__banManager.unBanList(time.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(time.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) | 34,423 |
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(): aInfo = dict() aInfo["ip"] = ticket.getIP() logSys.warn("[%s] Unban %s" % (self.jail.getName(), aInfo["ip"])) for action in self.__actions: action.execActionUnban(aInfo) | 34,424 |
def __setFilePos(self): line = self.__crtHandler.readline() lastDate = self.__lastDate[self.__crtFilename] lineDate = self.dateDetector.getUnixTime(line) print lastDate print lineDate if lastDate < lineDate: logSys.debug("Date " + `lastDate` + " is smaller than " + `lineDate`) logSys.debug("Log rotation detected for " ... | def __setFilePos(self): line = self.__crtHandler.readline() lastDate = self.__lastDate[self.__crtFilename] lineDate = self.dateDetector.getUnixTime(line) if lastDate < lineDate: logSys.debug("Date " + `lastDate` + " is smaller than " + `lineDate`) logSys.debug("Log rotation detected for " + self.__crtFilename) self.__l... | 34,425 |
def usage(): print "fail2ban [-h][-v][-b]" sys.exit(0) | def usage(): print "fail2ban [-h][-v][-b][-d][-f <pwdfail file>][-l <log file>]" sys.exit(0) | 34,426 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | defos.chdir("/") createDaemon():os.chdir("/") """Detachos.chdir("/") aos.chdir("/") processos.chdir("/") fromos.chdir("/") theos.chdir("/") controllingos.chdir("/") terminalos.chdir("/") andos.chdir("/") runos.chdir("/") itos.chdir("/") inos.chdir("/") theos.chdir("/") backgroundos.chdir("/") asos.chdir("/") aos.chdir(... | 34,427 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,428 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,429 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,430 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,431 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,432 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,433 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,434 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,435 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,436 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,437 |
def dispUsage(): """ Prints Fail2Ban command line options and exits """ print "Usage: "+sys.argv[0]+" [OPTIONS]" print print "Fail2Ban v"+version+" reads log file that contains password failure report" print "and bans the corresponding IP addresses using firewall rules." print print " -b start in background" p... | def dispUsage(): """ Prints Fail2Ban command line options and exits """ print "Usage: "+sys.argv[0]+" [OPTIONS]" print print "Fail2Ban v"+version+" reads log file that contains password failure report" print "and bans the corresponding IP addresses using firewall rules." print print " -b start in background" p... | 34,438 |
def initialize(self, force = False): # Remove socket if os.path.exists(SSocket.SOCKET_FILE): logSys.error("Fail2ban seems to be already running") if force: logSys.warn("Forcing execution of the server") os.remove(SSocket.SOCKET_FILE) else: raise SSocketErrorException("Server already running") # Create an INET, STREAMin... | def initialize(self, force = False): # Remove socket if os.path.exists(SSocket.SOCKET_FILE): logSys.error("Fail2ban seems to be already running") if force: logSys.warn("Forcing execution of the server") os.remove(SSocket.SOCKET_FILE) else: raise SSocketErrorException("Server already running") # Create an INET, STREAMin... | 34,439 |
def run(self): self.isRunning = True while self.isRunning: # TODO Fix shutdown. A new request is required because accept() # is blocking. (csock, address) = self.ssock.accept() thread = SocketWorker(csock, self.transmit) thread.start() self.ssock.close() # Remove socket if os.path.exists(SSocket.SOCKET_FILE): logSys.de... | def run(self): self.isRunning = True while self.isRunning: # TODO Fix shutdown. A new request is required because accept() # is blocking. (csock, address) = self.ssock.accept() thread = SocketWorker(csock, self.transmit) thread.start() self.ssock.close() # Remove socket if os.path.exists(SSocket.SOCKET_FILE): logSys.de... | 34,440 |
def searchIP(text): """ Search if an IP address if directly available and return it. """ print DNSUtils.ipCRE match = DNSUtils.ipCRE.match(text) if match: return match else: return None | def searchIP(text): """ Search if an IP address if directly available and return it. """ match = DNSUtils.ipCRE.match(text) if match: return match else: return None | 34,441 |
def textToIp(text): """ Return the IP of DNS found in a given text. """ ipList = list() # Search for plain IP plainIP = DNSUtils.searchIP(text) if not plainIP == None: if isValidIP(element): ipList.append(element) if not ipList: # Try to get IP from possible DNS dnsList = DNSUtils.textToDns(text) if not dnsList == None... | def textToIp(text): """ Return the IP of DNS found in a given text. """ ipList = list() # Search for plain IP plainIP = DNSUtils.searchIP(text) if not plainIP == None: plainIPStr = plainIP.group(0) if DNSUtils.isValidIP(plainIPStr): ipList.append(plainIPStr) if not ipList: # Try to get IP from possible DNS dnsList = DN... | 34,442 |
def textToIp(text): """ Return the IP of DNS found in a given text. """ ipList = list() # Search for plain IP plainIP = DNSUtils.searchIP(text) if not plainIP == None: if isValidIP(element): ipList.append(element) if not ipList: # Try to get IP from possible DNS dnsList = DNSUtils.textToDns(text) if not dnsList == None... | def textToIp(text): """ Return the IP of DNS found in a given text. """ ipList = list() # Search for plain IP plainIP = DNSUtils.searchIP(text) if not plainIP == None: if isValidIP(element): ipList.append(element) if not ipList: # Try to get IP from possible DNS dns = DNSUtils.textToDns(text) if not dns == None: ip = D... | 34,443 |
def textToDns(text): """ Search for possible DNS in an arbitrary text. """ match = re.findall("\S*\.\w*\.\w*", text) if match: return match else: return [] | def textToDns(text): """ Search for possible DNS in an arbitrary text. """ match = re.findall("(?:(?:\w|-)+\.){2,}\w+", text) if match: return match else: return [] | 34,444 |
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the... | 34,445 |
def killPID(pid): """ Kills the process with the given PID using the INT signal (same effect as <ctrl>+<c>). """ return os.kill(pid, 2) | def killPID(pid): """ Kills the process with the given PID using the INT signal (same effect as <ctrl>+<c>). """ try: return os.kill(pid, 2) except OSError: logSys.error("Can not kill process " + `pid` + ". Please check that " + "Fail2Ban is not running and remove the file " + "'/tmp/fail2ban.pid'") | 34,446 |
def __init__(self, interface, *attributes) : self.interface = interface self.attributes = attributes | def __init__(self, interface, *attributes) : self.interface = interface self.attributes = attributes | 34,447 |
def __init__(self, interface, *attributes) : self.interface = interface self.attributes = attributes | def __init__(self, interface, *attributes) : self.interface = interface self.attributes = attributes | 34,448 |
def __init__(self, interface, *attributes) : self.interface = interface self.attributes = attributes | def __init__(self, interface, *attributes) : self.interface = interface self.attributes = attributes | 34,449 |
def __init__(self, object, *descriptions) : """ Init with a list of modification descriptions. >>> from zope.interface import implements, Interface, Attribute >>> class ISample(Interface) : ... field = Attribute("A test field") >>> class Sample(object) : ... implements(ISample) >>> obj = Sample() >>> obj.fiel... | def __init__(self, object, *descriptions) : """ Init with a list of modification descriptions. >>> from zope.interface import implements, Interface, Attribute >>> class ISample(Interface) : ... field = Attribute("A test field") >>> class Sample(object) : ... implements(ISample) >>> obj = Sample() >>> obj.fiel... | 34,450 |
def __init__(self, object, *descriptions) : """ Init with a list of modification descriptions. >>> from zope.interface import implements, Interface, Attribute >>> class ISample(Interface) : ... field = Attribute("A test field") >>> class Sample(object) : ... implements(ISample) >>> obj = Sample() >>> obj.fiel... | def __init__(self, object, *descriptions) : """ Init with a list of modification descriptions. >>> from zope.interface import implements, Interface, Attribute >>> class ISample(Interface) : ... field = Attribute("A test field") >>> class Sample(object) : ... implements(ISample) >>> obj = Sample() >>> obj.fiel... | 34,451 |
def __init__(self, object, *descriptions) : """ Init with a list of modification descriptions. >>> from zope.interface import implements, Interface, Attribute >>> class ISample(Interface) : ... field = Attribute("A test field") >>> class Sample(object) : ... implements(ISample) >>> obj = Sample() >>> obj.fiel... | def __init__(self, object, *descriptions) : """ Init with a list of modification descriptions. >>> from zope.interface import implements, Interface, Attribute >>> class ISample(Interface) : ... field = Attribute("A test field") >>> class Sample(object) : ... implements(ISample) >>> obj = Sample() >>> obj.fiel... | 34,452 |
def __init__(self, object, *descriptions) : """ Init with a list of modification descriptions. >>> from zope.interface import implements, Interface, Attribute >>> class ISample(Interface) : ... field = Attribute("A test field") >>> class Sample(object) : ... implements(ISample) >>> obj = Sample() >>> obj.fiel... | def __init__(self, object, *descriptions) : """ Init with a list of modification descriptions. >>> from zope.interface import implements, Interface, Attribute >>> class ISample(Interface) : ... field = Attribute("A test field") >>> class Sample(object) : ... implements(ISample) >>> obj = Sample() >>> obj.fiel... | 34,453 |
def __init__(self, object, *descriptions) : """ Init with a list of modification descriptions. >>> from zope.interface import implements, Interface, Attribute >>> class ISample(Interface) : ... field = Attribute("A test field") >>> class Sample(object) : ... implements(ISample) >>> obj = Sample() >>> obj.fiel... | def __init__(self, object, *descriptions) : """ Init with a list of modification descriptions. >>> from zope.interface import implements, Interface, Attribute >>> class ISample(Interface) : ... field = Attribute("A test field") >>> class Sample(object) : ... implements(ISample) >>> obj = Sample() >>> obj.fiel... | 34,454 |
def test_annotations(): """Broken objects may have attribute annotations If they do, we can access them:: >>> from zope.app.broken.broken import Broken >>> b = Broken() >>> b.__setstate__({'__annotations__': {'foo.bar': 42}}) >>> b['foo.bar'] 42 >>> b.get('foo.bar') 42 Missing keys are handled as expected: >>> b['f... | def test_annotations(): """Broken objects may have attribute annotations If they do, we can access them:: >>> from zope.app.broken.broken import Broken >>> b = Broken() >>> b.__setstate__({'__annotations__': {'foo.bar': 42}}) >>> b['foo.bar'] 42 >>> b.get('foo.bar') 42 Missing keys are handled as expected: >>> b['f... | 34,455 |
def beforeChange_schema(self): """Load the values of fields from according to fields_map if present. Each key in fields_map is a field in the old schema and each value is a field in the new schema. If fields_map isn't a mapping, each filed in the old schema will be migrated into the new schema. Obeys field modes for ... | def beforeChange_schema(self): """Load the values of fields from according to fields_map if present. Each key in fields_map is a field in the old schema and each value is a field in the new schema. If fields_map isn't a mapping, each filed in the old schema will be migrated into the new schema. Obeys field modes for ... | 34,456 |
def migrate_references(self): """Migrate references annotation.""" # Restor the references annotation if hasattr(self, REFERENCE_ANNOTATION): at_references = getattr(self, REFERENCE_ANNOTATION) setattr(self.new, REFERENCE_ANNOTATION, at_references) # Run the reference manage_afterAdd to transition all copied # referenc... | def migrate_references(self): """Migrate references annotation.""" # Restor the references annotation if hasattr(self, REFERENCE_ANNOTATION): at_references = getattr(self, REFERENCE_ANNOTATION) setattr(self.new, REFERENCE_ANNOTATION, at_references) # Run the reference manage_afterAdd to transition all copied # referenc... | 34,457 |
def migrate_references(self): """Migrate references annotation.""" # Restor the references annotation if hasattr(self, REFERENCE_ANNOTATION): at_references = getattr(self, REFERENCE_ANNOTATION) setattr(self.new, REFERENCE_ANNOTATION, at_references) # Run the reference manage_afterAdd to transition all copied # referenc... | def migrate_references(self): """Migrate references annotation.""" # Restor the references annotation if hasattr(self, REFERENCE_ANNOTATION): at_references = getattr(self, REFERENCE_ANNOTATION) setattr(self.new, REFERENCE_ANNOTATION, at_references) # Run the reference manage_afterAdd to transition all copied # referenc... | 34,458 |
def get_ole_storages(filename): STORAGES = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_se... | def get_ole_streams(filename): STREAMS = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_sect... | 34,459 |
def get_ole_storages(filename): STORAGES = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_se... | def get_ole_storages(filename): STORAGES = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_se... | 34,460 |
def get_ole_storages(filename): STORAGES = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_se... | def get_ole_storages(filename): STORAGES = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_se... | 34,461 |
def get_ole_storages(filename): STORAGES = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_se... | def get_ole_streams(filename): STREAMS = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_sect... | 34,462 |
def get_ole_storages(filename): STORAGES = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_se... | def get_ole_storages(filename): STORAGES = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_se... | 34,463 |
def get_ole_storages(filename): STORAGES = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_se... | def get_ole_storages(filename): STORAGES = {} doc = file(filename, 'rb').read() header, data = doc[0:512], doc[512:] del doc doc_magic = header[0:8] file_uid = header[8:24] rev_num = header[24:26] ver_num = header[26:28] byte_order = header[28:30] log_se... | 34,464 |
def kill(pid, sig): """Send the signal sig to the remote process. """ # open the remote process # XXX why we need PROCESS_VM_OPERATION? flags = PROCESS_CREATE_THREAD | PROCESS_VM_OPERATION hProcess = OpenProcess(flags, False, pid) # obtain the address of the raise method in the MSVCR71 module pfn = GetRemoteProcAddre... | def kill(pid, sig): """Send the signal sig to the remote process. """ # open the remote process # XXX why we need PROCESS_VM_OPERATION? flags = PROCESS_CREATE_THREAD | PROCESS_VM_OPERATION hProcess = OpenProcess(flags, False, pid) # obtain the address of the raise method in the MSVCR71 module pfn = GetRemoteProcAddre... | 34,465 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,466 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,467 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,468 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,469 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,470 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,471 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,472 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,473 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,474 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,475 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,476 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,477 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,478 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,479 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,480 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,481 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,482 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,483 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,484 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,485 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,486 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,487 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,488 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,489 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,490 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,491 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,492 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,493 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,494 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,495 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,496 |
def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 34,497 |
def __convertPropertyValueList( self, aValueList ): aList = list() | def __convertPropertyValueList( self, aValueList ): aList = list() | 34,498 |
def createSystemPathFromFullID( aSystemFullID ): if aSystemFullID[SYSTEMPATH] == '/': if aSystemFullID[ID] == '/': aNewSystemPath = '/' else: aNewSystemPath = '/' + aSystemFullID[ID] else: aNewSystemPath = aSystemFullID[SYSTEMPATH] + '/' +\ aSystemFullID[ID] return aNewSystemPath | def createSystemPathFromFullID( aSystemFullID ): if aSystemFullID[SYSTEMPATH] == '': if aSystemFullID[ID] == '/': aNewSystemPath = '/' else: aNewSystemPath = '/' + aSystemFullID[ID] else: aNewSystemPath = aSystemFullID[SYSTEMPATH] + '/' +\ aSystemFullID[ID] return aNewSystemPath | 34,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.