bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def process(self, pyfile): self.html = self.load(self.pyfile.url, cookies=True if self.account else False) if re.search(r"Such file does not exist or it has been removed for infringement of copyrights", self.html): self.offline() if not self.account: self.handleFree() pyfile.name = re.search('File name: <b title="(.... | def process(self, pyfile): self.html = self.load(self.pyfile.url, cookies=True if self.account else False) if re.search(r"Such file does not exist or it has been removed for infringement of copyrights", self.html): self.offline() if not self.account: self.handleFree() pyfile.name = re.search('File name: <b title="(.... | 450,300 |
def getInfo(urls): ids = "" names = "" p = re.compile(RapidshareCom.__pattern__) for url in urls: r = p.search(url) if r.group("name"): ids+= ","+r.group("id") names+= ","+r.group("name") elif r.group("name_new"): ids+= ","+r.group("id_new") names+= ","+r.group("name_new") url = "http://api.rapidshare.com/cgi-bin/... | def getInfo(urls): ids = "" names = "" p = re.compile(RapidshareCom.__pattern__) for url in urls: r = p.search(url) if r.group("name"): ids+= ","+r.group("id") names+= ","+r.group("name") elif r.group("name_new"): ids+= ","+r.group("id_new") names+= ","+r.group("name_new") url = "http://api.rapidshare.com/cgi-bin/... | 450,301 |
def run(self): """run method""" | def run(self): """run method""" | 450,302 |
def get_file_url(self): """ returns the absolute downloadable filepath """ if self.html == None: self.download_html() if not self.want_reconnect: file_url = re.search('a href=\"(.*?)\".*?button\.basic\.jpg', self.htmlwithlink).group(1) #print file_url return file_url else: return False | def get_file_url(self): """ returns the absolute downloadable filepath """ if self.html == None: self.download_html() if not self.want_reconnect: file_url = re.search('a href=\"(.*?)\" id=\"downloadLinkTarget\"', self.htmlwithlink).group(1) #print file_url return file_url else: return False | 450,303 |
def getHomeDir(self): try: from win32com.shell import shellcon, shell return shell.SHGetFolderPath(0, shellcon.CSIDL_APPDATA, 0, 0) except ImportError: # quick semi-nasty fallback for non-windows/win32com case return expanduser("~") | def getHomeDir(self): try: from win32com.shell import shellcon, shell return shell.SHGetFolderPath(0, shellcon.CSIDL_APPDATA, 0, 0) except ImportError: # quick semi-nasty fallback for non-windows/win32com case if platform == 'nt': import ctypes from ctypes import wintypes, windll CSIDL_APPDATA = 26 _SHGetFolderPath = c... | 450,304 |
def initReconnect(self): """initialise a reonnect""" if not self.parent.config['reconnect']['activated'] or self.reconnecting or not self.parent.server_methods.is_time_reconnect(): return False | def initReconnect(self): """initialise a reonnect""" if not self.parent.config['reconnect']['activated'] or self.reconnecting or not self.parent.server_methods.is_time_reconnect(): return False | 450,305 |
def reconnect(self): self.parent.logger.info(_("Starting reconnect")) ip = re.match(".*Current IP Address: (.*)</body>.*", getURL("http://checkip.dyndns.org/")).group(1) self.parent.hookManager.beforeReconnecting(ip) reconn = subprocess.Popen(self.parent.config['reconnect']['method'])#, stdout=subprocess.PIPE) reconn.w... | def reconnect(self): self.parent.logger.info(_("Starting reconnect")) ip = re.match(".*Current IP Address: (.*)</body>.*", getURL("http://checkip.dyndns.org/")).group(1) self.parent.hookManager.beforeReconnecting(ip) reconn = subprocess.Popen(self.parent.config['reconnect']['method'])#, stdout=subprocess.PIPE) reconn.w... | 450,306 |
def reconnect(self): self.parent.logger.info(_("Starting reconnect")) ip = re.match(".*Current IP Address: (.*)</body>.*", getURL("http://checkip.dyndns.org/")).group(1) self.parent.hookManager.beforeReconnecting(ip) reconn = subprocess.Popen(self.parent.config['reconnect']['method'])#, stdout=subprocess.PIPE) reconn.w... | def reconnect(self): self.parent.logger.info(_("Starting reconnect")) ip = re.match(".*Current IP Address: (.*)</body>.*", getURL("http://checkip.dyndns.org/")).group(1) self.parent.hookManager.beforeReconnecting(ip) reconn = subprocess.Popen(self.parent.config['reconnect']['method'])#, stdout=subprocess.PIPE) reconn.w... | 450,307 |
def run(self): """run method""" | def run(self): """run method""" | 450,308 |
def run(self): """run method""" | def run(self): """run method""" | 450,309 |
def getJob(self, occ): """return pyfile instance, which is suitable for download and dont use a occupied plugin""" self.c.execute("SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=1 AND l.plugin NOT IN %s AND l.status IN (2,3,6) LIMIT 5" % str(occ)) # very bad! | def getJob(self, occ): """return pyfile instance, which is suitable for download and dont use a occupied plugin""" self.c.execute("SELECT l.id FROM links as l INNER JOIN packages as p ON l.package=p.id WHERE p.queue=1 AND l.plugin NOT IN %s AND l.status IN (2,3,6) LIMIT 5" % occ) # very bad! | 450,310 |
def __init__(self, interface=None): | def __init__(self, interface=None): | 450,311 |
def get_waiting_time(self): if self.html is None: self.download_html() if "Der Traffic f\xc3\xbcr heute ist verbraucht!" in self.html: self.wantReconnect = True return 24*3600 timestring = re.search('\s*var\stime\s=\s(\d*?)\.\d*;', self.html).group(1) if timestring: sec = int(timestring) + 1 #add 1 sec as tenths of s... | def get_waiting_time(self): if self.html is None: self.download_html() if "Der Traffic f\xc3\xbcr heute ist verbraucht!" in self.html or "Your Traffic is used up for today" in self.html: self.wantReconnect = True return 24*3600 timestring = re.search('\s*var\stime\s=\s(\d*?)\.\d*;', self.html).group(1) if timestring:... | 450,312 |
def init(self, first=False): """ set main things up """ self.parser = XMLParser(join(self.configdir, "gui.xml"), join(self.path, "module", "config", "gui_default.xml")) lang = self.parser.xml.elementsByTagName("language").item(0).toElement().text() if not lang: parser = XMLParser(join(self.path, "module", "config", "gu... | def init(self, first=False): """ set main things up """ self.parser = XMLParser(join(self.configdir, "gui.xml"), join(self.path, "module", "config", "gui_default.xml")) lang = self.parser.xml.elementsByTagName("language").item(0).toElement().text() if not lang: parser = XMLParser(join(self.path, "module", "config", "gu... | 450,313 |
def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print "" try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing" try: import Crypto print "py... | def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print "" try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing" try: import Crypto print "py-crypto:", Crypto... | 450,314 |
def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print "" try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing" try: import Crypto print "py... | defmain():print"#####SystemInformation#####"print""print"Platform:",sys.platformprint"OperatingSystem:",os.nameprint"Python:",sys.version.replace("\n","")printos.uname()print""try:importpycurlprint"pycurl:",pycurl.versionexcept:print"pycurl:","missing"try:importCryptoprint"py-crypto:",Crypto.__version__except:print"py-... | 450,315 |
def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print "" try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing" try: import Crypto print "py... | def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print ""try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing"try: import Crypto print "py-crypto:... | 450,316 |
def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print "" try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing" try: import Crypto print "py... | defmain():print"#####SystemInformation#####"print""print"Platform:",sys.platformprint"OperatingSystem:",os.nameprint"Python:",sys.version.replace("\n","")printos.uname()print""try:importpycurlprint"pycurl:",pycurl.versionexcept:print"pycurl:","missing"try:importCryptoprint"py-crypto:",Crypto.__version__except:print"py-... | 450,317 |
def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print "" try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing" try: import Crypto print "py... | defmain():print"#####SystemInformation#####"print""print"Platform:",sys.platformprint"OperatingSystem:",os.nameprint"Python:",sys.version.replace("\n","")printos.uname()print""try:importpycurlprint"pycurl:",pycurl.versionexcept:print"pycurl:","missing"try:importCryptoprint"py-crypto:",Crypto.__version__except:print"py-... | 450,318 |
def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print "" try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing" try: import Crypto print "py... | def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print ""try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing"try: import Crypto print "py-crypto:... | 450,319 |
def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print "" try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing" try: import Crypto print "py... | def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print ""try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing"try: import Crypto print "py-crypto:... | 450,320 |
def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print "" try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing" try: import Crypto print "py... | def main(): print "##### System Information #####" print "" print "Platform:", sys.platform print "Operating System:", os.name print "Python:", sys.version.replace("\n", "") print os.uname() print "" try: import pycurl print "pycurl:", pycurl.version except: print "pycurl:", "missing" try: import Crypto print "py... | 450,321 |
def handleFree(self): | defhandleFree(self): | 450,322 |
def download_api_data(self, force=False): """ http://images.rapidshare.com/apidoc.txt """ if self.api_data and not force: return api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param_file = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1", "files": self.id, "filenames": self.name} s... | def download_api_data(self, force=False): """ http://images.rapidshare.com/apidoc.txt """ if self.api_data and not force: return api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param_file = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1", "files": self.id, "filenames": self.name} s... | 450,323 |
def __init__(self, parent): Plugin.__init__(self, parent) props = {} props['name'] = "RapidshareCom" props['type'] = "hoster" props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)" props['version'] = "1.0" props['description'] = """Rapidshare.com Download Plugin""" props['author_name'] = ("spoob", "RaNaN... | def __init__(self, parent): Plugin.__init__(self, parent) props = {} props['name'] = "RapidshareCom" props['type'] = "hoster" props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)" props['version'] = "1.0" props['description'] = """Rapidshare.com Download Plugin""" props['author_name'] = ("spoob", "RaNaN... | 450,324 |
def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() self.no_slots = True self.want_reconnect = False | def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() self.no_slots = True self.want_reconnect = False | 450,325 |
def download_html(self): """ gets the url from self.parent.url saves html in self.html and parses """ self.html[0] = self.req.load(self.url, cookies=True) self.html_old = time() | def download_html(self): """ gets the url from self.parent.url saves html in self.html and parses """ self.html[0] = self.req.load(self.url, cookies=True) self.html_old = time() | 450,326 |
def get_wait_time(self): """downloads html with the important informations """ file_server_url = re.search(r"<form action=\"(.*?)\"", self.html[0]).group(1) self.html[1] = self.req.load(file_server_url, cookies=True, post={"dl.start": "Free"}) self.html_old = time() | def get_wait_time(self): """downloads html with the important informations """ file_server_url = re.search(r"<form action=\"(.*?)\"", self.html[0]).group(1) self.html[1] = self.req.load(file_server_url, cookies=True, post={"dl.start": "Free"}) self.html_old = time() | 450,327 |
def get_wait_time(self): """downloads html with the important informations """ file_server_url = re.search(r"<form action=\"(.*?)\"", self.html[0]).group(1) self.html[1] = self.req.load(file_server_url, cookies=True, post={"dl.start": "Free"}) self.html_old = time() | def get_wait_time(self): """downloads html with the important informations """ file_server_url = re.search(r"<form action=\"(.*?)\"", self.html[0]).group(1) self.html[1] = self.req.load(file_server_url, cookies=True, post={"dl.start": "Free"}) self.html_old = time() | 450,328 |
def run(self): # connect to IRC etc. self.sock = socket.socket() self.sock.connect((self.getConf("host"), self.getConf("port"))) nick = self.getConf("nick") self.sock.send("NICK %s\r\n" % nick) self.sock.send("USER %s %s bla :%s\r\n" % (nick, self.getConf("host"), nick)) for t in self.getConf("owner").split(): if t.str... | def run(self): # connect to IRC etc. self.sock = socket.socket() host = self.getConfig("host") self.sock.connect((host, self.getConfig("port"))) nick = self.getConfig("nick") self.sock.send("NICK %s\r\n" % nick) self.sock.send("USER %s %s bla :%s\r\n" % (nick, self.getConf("host"), nick)) for t in self.getConf("owner")... | 450,329 |
def run(self): # connect to IRC etc. self.sock = socket.socket() self.sock.connect((self.getConf("host"), self.getConf("port"))) nick = self.getConf("nick") self.sock.send("NICK %s\r\n" % nick) self.sock.send("USER %s %s bla :%s\r\n" % (nick, self.getConf("host"), nick)) for t in self.getConf("owner").split(): if t.str... | def run(self): # connect to IRC etc. self.sock = socket.socket() self.sock.connect((self.getConf("host"), self.getConf("port"))) nick = self.getConf("nick") self.sock.send("NICK %s\r\n" % nick) self.sock.send("USER %s %s bla :%s\r\n" % (nick, host, nick)) for t in self.getConfig("owner").split(): if t.strip().startswit... | 450,330 |
def run(self): # connect to IRC etc. self.sock = socket.socket() self.sock.connect((self.getConf("host"), self.getConf("port"))) nick = self.getConf("nick") self.sock.send("NICK %s\r\n" % nick) self.sock.send("USER %s %s bla :%s\r\n" % (nick, self.getConf("host"), nick)) for t in self.getConf("owner").split(): if t.str... | def run(self): # connect to IRC etc. self.sock = socket.socket() self.sock.connect((self.getConf("host"), self.getConf("port"))) nick = self.getConf("nick") self.sock.send("NICK %s\r\n" % nick) self.sock.send("USER %s %s bla :%s\r\n" % (nick, self.getConf("host"), nick)) for t in self.getConf("owner").split(): if t.str... | 450,331 |
def handle_events(self, msg): if msg["origin"].split("!", 1)[0] != self.owner: return if msg["target"].split("!", 1)[0] != self.nick: return if msg["action"] != "PRIVMSG": return # HANDLE CTCP ANTI FLOOD/BOT PROTECTION if msg["text"] == "\x01VERSION\x01": self.log.debug("Sending CTCP VERSION.") self.sock.send("NOTIC... | def handle_events(self, msg): if not msg["origin"].split("!", 1)[0] in self.getConfig("owner").split(): return if msg["target"].split("!", 1)[0] != self.getConfig("nick"): return if msg["action"] != "PRIVMSG": return # HANDLE CTCP ANTI FLOOD/BOT PROTECTION if msg["text"] == "\x01VERSION\x01": self.log.debug("Sending... | 450,332 |
def response(self, msg, origin=""): if origin == "": for t in self.getConf("owner").split(): self.sock.send("PRIVMSG %s :%s\r\n" % (t.strip(), msg)) else: self.sock.send("PRIVMSG %s :%s\r\n" % (origin.split("!", 1)[0], msg)) | def response(self, msg, origin=""): if origin == "": for t in self.getConfig("owner").split(): self.sock.send("PRIVMSG %s :%s\r\n" % (t.strip(), msg)) else: self.sock.send("PRIVMSG %s :%s\r\n" % (origin.split("!", 1)[0], msg)) | 450,333 |
def jobFinished(self, pyfile): """manage completing download""" self.lock.acquire() | def jobFinished(self, pyfile): """manage completing download""" self.lock.acquire() | 450,334 |
def path_make_relative(path): p = os.path.relpath(path) if p[-1] == os.path.sep: return p else: return p + os.path.sep | def path_make_relative(path): p = relpath(path) if p[-1] == os.path.sep: return p else: return p + os.path.sep | 450,335 |
def getInfo(urls): result = [] for url in urls: html = getURL(url) if re.search(r'<h1>File not available</h1>', html): result.append((url, 0, 1, url)) continue size = re.search(r'<span style="float: left;"><strong>(.*?) MB</strong>', html).group(1) size = int(float(size)*1024*1024) name = re.search('<h1>(.*?)<br/></... | def getInfo(urls): result = [] for url in urls: html = getURL(url) if re.search(r'<h1>File not available</h1>', html): result.append((url, 0, 1, url)) continue name = re.search('<h1>(.*?)<br/></h1>', html).group(1) result.append((name, size, 2, url)) yield result | 450,336 |
def handleFree(self): if r'<div id="captchaArea" style="display:none;">' in self.html or \ r'/showCaptcha\(\);' in self.html: # we got a captcha id = re.search(r"var reCAPTCHA_publickey='(.*?)';", self.html).group(1) recaptcha = ReCaptcha(self) challenge, code = recaptcha.challenge(id) shortencode = re.search(r'name=... | def handleFree(self): if r'<div id="captchaArea" style="display:none;">' in self.html or \ r'/showCaptcha\(\);' in self.html: # we got a captcha id = re.search(r"var reCAPTCHA_publickey='(.*?)';", self.html).group(1) recaptcha = ReCaptcha(self) challenge, code = recaptcha.challenge(id) shortencode = re.search(r'name=... | 450,337 |
def __init__(self, pyfile): self.config = pyfile.m.core.config self.core = pyfile.m.core | def __init__(self, pyfile): self.config = pyfile.m.core.config self.core = pyfile.m.core | 450,338 |
def init(self, first=False): """ set main things up """ self.parser = XMLParser("module/config/gui.xml", "module/config/gui_default.xml") langNode = self.parser.xml.elementsByTagName("language").item(0).toElement() translation = gettext.translation("pyLoadGui", join(dirname(__file__), "locale"), languages=[str(langNode... | def init(self, first=False): """ set main things up """ self.parser = XMLParser("module/config/gui.xml", "module/config/gui_default.xml") lang = self.parser.xml.elementsByTagName("language").item(0).toElement().text() if not lang: parser = XMLParser("module/config/gui_default.xml") lang = parser.xml.elementsByTagName("... | 450,339 |
def get_file_url(self): """ returns the absolute downloadable filepath """ if self.html == None: self.download_html() | def get_file_url(self): """ returns the absolute downloadable filepath """ if self.html == None: self.download_html() | 450,340 |
def get_file_url(self): """ returns the absolute downloadable filepath """ if self.html == None: self.download_html() | def get_file_url(self): """ returns the absolute downloadable filepath """ if self.html == None: self.download_html() | 450,341 |
def doDownload(self): """ returns the absolute downloadable filepath """ if self.html is None: self.download_html() | def doDownload(self): """ returns the absolute downloadable filepath """ if self.html is None: self.download_html() | 450,342 |
def doDownload(self): """ returns the absolute downloadable filepath """ if self.html is None: self.download_html() | def doDownload(self): """ returns the absolute downloadable filepath """ if self.html is None: self.download_html() | 450,343 |
def __init__(self, archive, tmpdir=None, ramSize=0, cpu=0): """ archive should be be first or only part """ self.archive = archive self.pattern = None m = re.match("^(.*).part(\d+).rar$", archive) if m: self.pattern = "%s.part*.rar" % m.group(1) else: #old style self.pattern = "%s.r*" % archive.replace(".rar", "") if o... | def __init__(self, archive, tmpdir=None, ramSize=0, cpu=0): """ archive should be be first or only part """ self.archive = archive self.pattern = None m = re.match("^(.*).part(\d+).rar$", archive) if m: self.pattern = "%s.part*.rar" % m.group(1) else: #old style self.pattern = "%s.r*" % archive.replace(".rar", "") if o... | 450,344 |
def renice(self, p): """ renice process """ if os.name != "nt" and self.cpu: try: Popen(["renice", self.cpu, p.pid], stdout=PIPE, bufsize=-1) except: try: Popen(["busybox", "renice", self.cpu, p.pid], stdout=PIPE, bufsize=-1) except: print "Renice failed" | def renice(self, p): """ renice process """ if os.name != "nt" and self.cpu: try: Popen(["renice", str(self.cpu), str(p.pid)], stdout=PIPE, stderr=PIPE,bufsize=-1) except: try: Popen(["busybox", "renice", self.cpu, p.pid], stdout=PIPE, bufsize=-1) except: print "Renice failed" | 450,345 |
def renice(self, p): """ renice process """ if os.name != "nt" and self.cpu: try: Popen(["renice", self.cpu, p.pid], stdout=PIPE, bufsize=-1) except: try: Popen(["busybox", "renice", self.cpu, p.pid], stdout=PIPE, bufsize=-1) except: print "Renice failed" | def renice(self, p): """ renice process """ if os.name != "nt" and self.cpu: try: Popen(["renice", self.cpu, p.pid], stdout=PIPE, bufsize=-1) except: try: Popen(["busybox", "renice", self.cpu, p.pid], stdout=PIPE, bufsize=-1) except: print "Renice failed" | 450,346 |
def listContent(self, password=None): """ returns a list with all infos to the files in the archive dict keys: name, version, method, crc, attributes, time, date, ratio, size_packed, size @return list(dict, dict, ...) """ f = self.archive if self.pattern: f = self.pattern args = self.cmd + ["v"] if password: args.appen... | def listContent(self, password=None): """ returns a list with all infos to the files in the archive dict keys: name, version, method, crc, attributes, time, date, ratio, size_packed, size @return list(dict, dict, ...) """ f = self.archive if self.pattern: f = self.pattern args = [self.cmd, "v"] if password: args.append... | 450,347 |
def checkPassword(self, password, statusFunction=None): """ check if password is okay @return bool """ if not self.needPassword(): return True f = self.archive if self.pattern: f = self.pattern args = self.cmd + ["t", "-p%s" % password, f] try: args.append(self.getSmallestFile(password)["name"]) except WrongPasswordErr... | def checkPassword(self, password, statusFunction=None): """ check if password is okay @return bool """ if not self.needPassword(): return True f = self.archive if self.pattern: f = self.pattern args = [self.cmd, "t", "-p%s" % password, f] try: args.append(self.getSmallestFile(password)["name"]) except WrongPasswordErro... | 450,348 |
def extract(self, password=None, fullPath=True, files=[], exclude=[], destination=None, overwrite=False, statusFunction=None): """ extract the archive @return bool: extract okay? raises WrongPasswordError or CommandError """ f = self.archive if self.pattern: f = self.pattern args = self.cmd if fullPath: args.append("x"... | def extract(self, password=None, fullPath=True, files=[], exclude=[], destination=None, overwrite=False, statusFunction=None): """ extract the archive @return bool: extract okay? raises WrongPasswordError or CommandError """ f = self.archive if self.pattern: f = self.pattern args = [self.cmd] if fullPath: args.append("... | 450,349 |
def downloadHTML(self): self.html = self.load(self.pyfile.url, cookies=True) with open("sobiz_dump.html", "w") as f: f.write(self.html) if not self.account: html = self.load("%s/free/" % self.pyfile.url, post={"dl_free":"1"}, cookies=True) if re.search(r"/failure/full/1", self.req.lastEffectiveURL): self.setWait(120) ... | def downloadHTML(self): self.html = self.load(self.pyfile.url, cookies=True) if not self.account: html = self.load("%s/free/" % self.pyfile.url, post={"dl_free":"1"}, cookies=True) if re.search(r"/failure/full/1", self.req.lastEffectiveURL): self.setWait(120) self.log.debug("%s: no free slots, waiting 120 seconds" % (... | 450,350 |
def loadAccounts(self): """loads all accounts available""" if not exists("accounts.conf"): f = open("accounts.conf", "wb") f.write("version: " + str(ACC_VERSION)) f.close() f = open("accounts.conf", "rb") content = f.readlines() version = content.pop(0) version = version.split(":")[1].strip() | def loadAccounts(self): """loads all accounts available""" if not exists("accounts.conf"): f = open("accounts.conf", "wb") f.write("version: " + str(ACC_VERSION)) f.close() f = open("accounts.conf", "rb") content = f.readlines() version = content.pop(0) version = version.split(":")[1].strip() | 450,351 |
def getFileData(self, id): """returns dict with package information""" pyfile = self.getFile(id) return pyfile.toDbDict() | def getFileData(self, id): """returns dict with file information""" pyfile = self.getFile(id) return pyfile.toDbDict() | 450,352 |
def __init__(self): self.doDebug = False self.arg_links = [] self.pidfile = "./pyload.pid" | def__init__(self):self.doDebug=Falseself.arg_links=[]self.pidfile="./pyload.pid" | 450,353 |
def start(self, xmlrpc=True, web=True): """ starts the fun :D """ if not exists("pyload.conf"): from module.setup import Setup | def start(self, xmlrpc=True, web=True): """ starts the fun :D """ if not exists("pyload.conf"): from module.setup import Setup | 450,354 |
def start(self): """ starts the machine""" | def start(self): """ starts the machine""" | 450,355 |
def postCheck(self, dl): | def postCheck(self, dl): | 450,356 |
def postCheck(self, dl): | def postCheck(self, dl): | 450,357 |
def start(self, xmlrpc=True, web=True): """ starts the fun :D """ | def start(self, xmlrpc=True, web=True): """ starts the fun :D """ | 450,358 |
def start(self, xmlrpc=True, web=True): """ starts the fun :D """ | def start(self, xmlrpc=True, web=True): """ starts the fun :D """ | 450,359 |
def start(self, xmlrpc=True, web=True): """ starts the fun :D """ | def start(self, xmlrpc=True, web=True): """ starts the fun :D """ | 450,360 |
def start(self, xmlrpc=True, web=True): """ starts the fun :D """ | def start(self, xmlrpc=True, web=True): """ starts the fun :D """ | 450,361 |
def downloadFinished(self, pyfile): for script in self.scripts['download_finished']: try: out = subprocess.Popen([join(self.folder, 'download_finished', script), pyfile.plugin.props['name'], pyfile.url, pyfile.status.name, \ join(self.core.path,self.core.config['general']['download_folder'], pyfile.folder, pyfile.statu... | def downloadFinished(self, pyfile): for script in self.scripts['download_finished']: try: out = subprocess.Popen([join(self.folder, 'download_finished', script), pyfile.plugin.props['name'], pyfile.url, pyfile.status.filename, \ join(self.core.path,self.core.config['general']['download_folder'], pyfile.folder, pyfile.s... | 450,362 |
def getJob(self): """return job if suitable, otherwise send thread idle""" | def getJob(self): """return job if suitable, otherwise send thread idle""" | 450,363 |
def isDecryptWaiting(self): pyfiles = self.list.getDownloadList(self.occ_plugins) for pyfile in pyfiles: if pyfile.plugin.props['type'] == "container": return True return False | def isDecryptWaiting(self): pyfiles = self.list.getDownloadList(self.occ_plugins) for pyfile in pyfiles: if pyfile.plugin.__type__ == "container": return True return False | 450,364 |
def __str__(self): return str(self._Proxy__subject).replace(os.sep, Sep) | def __str__(self): return str(self._Proxy__subject).replace(os.sep, Sep) | 450,365 |
def build(num, target, source): file = open(str(target), 'wb') file.write('%s\n'%num) for s in source: file.write(open(str(s), 'rb').read()) | def build(num, target, source): file = open(str(target), 'wb') file.write('%s\n'%num) for s in source: file.write(open(str(s), 'rb').read()) | 450,366 |
def build(num, target, source): file = open(str(target), 'wb') file.write('%s\n'%num) for s in source: file.write(open(str(s), 'rb').read()) | def build(num, target, source): file = open(str(target), 'wb') file.write('%s\n'%num) for s in source: file.write(open(str(s), 'rb').read()) | 450,367 |
def __init__(self, node): # Create an object attribute from the class attribute so it ends up # in the pickled data in the .sconsign file. self._version_id = self.current_version_id | def __init__(self, node=None): # Create an object attribute from the class attribute so it ends up # in the pickled data in the .sconsign file. self._version_id = self.current_version_id | 450,368 |
def __init__(self, node): # Create an object attribute from the class attribute so it ends up # in the pickled data in the .sconsign file. self._version_id = self.current_version_id self.bsourcesigs = [] self.bdependsigs = [] self.bimplicitsigs = [] self.bactsig = None | def __init__(self, node=None): # Create an object attribute from the class attribute so it ends up # in the pickled data in the .sconsign file. self._version_id = self.current_version_id self.bsourcesigs = [] self.bdependsigs = [] self.bimplicitsigs = [] self.bactsig = None | 450,369 |
def scan_recurse(self, node, path=()): """ do a recursive scan of the top level target file This lets us search for included files based on the directory of the main file just as latex does""" | def scan_recurse(self, node, path=()): """ do a recursive scan of the top level target file This lets us search for included files based on the directory of the main file just as latex does""" | 450,370 |
def func(target, source, env): open(str(target[0]), "w") if (len(source) == 1 and len(target) == 1): env['CNT'][0] = env['CNT'][0] + 1 | def func(target, source, env): open(str(target[0]), "w") if (len(source) == 1 and len(target) == 1): env['CNT'][0] = env['CNT'][0] + 1 | 450,371 |
def func(target, source, env): open(str(target[0]), "w") if (len(source) == 1 and len(target) == 1): env['CNT'][0] = env['CNT'][0] + 1 | def func(target, source, env): open(str(target[0]), "w") if (len(source) == 1 and len(target) == 1): env['CNT'][0] = env['CNT'][0] + 1 | 450,372 |
def func(target, source, env): open(str(target[0]), "w") if (len(source) == 1 and len(target) == 1): env['CNT'][0] = env['CNT'][0] + 1 | def func(target, source, env): open(str(target[0]), "w") if (len(source) == 1 and len(target) == 1): env['CNT'][0] = env['CNT'][0] + 1 | 450,373 |
def processDefines(defs): """process defines, resolving strings, lists, dictionaries, into a list of strings """ if SCons.Util.is_List(defs): l = [] for d in defs: if SCons.Util.is_List(d) or isinstance(d, tuple): if len(d) >= 2: l.append(str(d[0]) + '=' + str(d[1])) else: l.append(str(d[0])) elif SCons.Util.is_Dict(d)... | def processDefines(defs): """process defines, resolving strings, lists, dictionaries, into a list of strings """ if SCons.Util.is_List(defs): l = [] for d in defs: if d is None: continue elif SCons.Util.is_List(d) or isinstance(d, tuple): if len(d) >= 2: l.append(str(d[0]) + '=' + str(d[1])) else: l.append(str(d[0])) e... | 450,374 |
def processDefines(defs): """process defines, resolving strings, lists, dictionaries, into a list of strings """ if SCons.Util.is_List(defs): l = [] for d in defs: if SCons.Util.is_List(d) or isinstance(d, tuple): if len(d) >= 2: l.append(str(d[0]) + '=' + str(d[1])) else: l.append(str(d[0])) elif SCons.Util.is_Dict(d)... | def processDefines(defs): """process defines, resolving strings, lists, dictionaries, into a list of strings """ if SCons.Util.is_List(defs): l = [] for d in defs: if SCons.Util.is_List(d) or isinstance(d, tuple): if len(d) >= 2: l.append(str(d[0]) + '=' + str(d[1])) else: l.append(str(d[0])) elif SCons.Util.is_Dict(d)... | 450,375 |
def tex_emitter_core(target, source, env, graphics_extensions): """An emitter for TeX and LaTeX sources. For LaTeX sources we try and find the common created files that are needed on subsequent runs of latex to finish tables of contents, bibliographies, indices, lists of figures, and hyperlink references. """ basename ... | def tex_emitter_core(target, source, env, graphics_extensions): """An emitter for TeX and LaTeX sources. For LaTeX sources we try and find the common created files that are needed on subsequent runs of latex to finish tables of contents, bibliographies, indices, lists of figures, and hyperlink references. """ basename ... | 450,376 |
def write(self, s): super(io.StringIO, self).write(unicode(s)) | def write(self, s): super(io.StringIO, self).write(unicode(s)) | 450,377 |
def write(self, s): super(io.StringIO, self).write(unicode(s)) | def write(self, s): super(io.StringIO, self).write(unicode(s)) | 450,378 |
def write(self, s): super(io.StringIO, self).write(unicode(s)) | def write(self, s): super(io.StringIO, self).write(unicode(s)) | 450,379 |
def get_all_compiler_versions(): """Returns a sorted list of strings, like "70" or "80" or "9.0" with most recent compiler version first. """ versions=[] if is_windows: if is_win64: keyname = 'Software\\WoW6432Node\\Intel\\Compilers\\C++' else: keyname = 'Software\\Intel\\Compilers\\C++' try: k = SCons.Util.RegOpenKeyE... | def get_all_compiler_versions(): """Returns a sorted list of strings, like "70" or "80" or "9.0" with most recent compiler version first. """ versions=[] if is_windows: if is_win64: keyname = 'Software\\WoW6432Node\\Intel\\Compilers\\C++' else: keyname = 'Software\\Intel\\Compilers\\C++' try: k = SCons.Util.RegOpenKeyE... | 450,380 |
def do_revisions(cr, opts, branch, revisions, scripts): """ Time the SCons branch specified scripts through a list of revisions. We assume we're in a (temporary) directory in which we can check out the source for the specified revisions. """ stdout = sys.stdout stderr = sys.stderr status = 0 if opts.logsdir and not ... | def do_revisions(cr, opts, branch, revisions, scripts): """ Time the SCons branch specified scripts through a list of revisions. We assume we're in a (temporary) directory in which we can check out the source for the specified revisions. """ stdout = sys.stdout stderr = sys.stderr status = 0 if opts.logsdir and not ... | 450,381 |
def msvc_version_to_maj_min(msvc_version): t = msvc_version.split(".") if not len(t) == 2: raise ValueError("Unrecognized version %s" % msvc_version) try: maj = int(t[0]) min = int(t[1]) return maj, min except ValueError, e: raise ValueError("Unrecognized version %s" % msvc_version) | def msvc_version_to_maj_min(msvc_version): msvc_ver_numeric = string.join(filter(lambda x: x in string.digits + ".", msvc_version), '') t = msvc_version_numeric.split(".") if not len(t) == 2: raise ValueError("Unrecognized version %s" % msvc_version) try: maj = int(t[0]) min = int(t[1]) return maj, min except ValueEr... | 450,382 |
def _semi_deepcopy_inst(x): if hasattr(x, '__semi_deepcopy__'): return x.__semi_deepcopy__() elif isinstance(x, UserDict): return x.__class__(_semi_deepcopy_dict(x)) elif isinstance(x, UserList): return x.__class__(_semi_deepcopy_list(x)) else: return x | def _semi_deepcopy_inst(x): if hasattr(x, '__semi_deepcopy__'): return x.__semi_deepcopy__() elif isinstance(x, UserDict): return x.__class__(_semi_deepcopy_dict(x)) elif isinstance(x, UserList): return x.__class__(_semi_deepcopy_list(x)) else: return x | 450,383 |
def f(self, x, y): self.z = x + y | def f(self, x, y): self.z = x + y | 450,384 |
def f_local(target, source, env, for_signature): return SCons.Action.Action(LocalFunc) | def f_local(target, source, env, for_signature, LocalFunc=LocalFunc): return SCons.Action.Action(LocalFunc) | 450,385 |
def f_local(target, source, env, for_signature): return SCons.Action.Action(LocalFunc, varlist=['XYZ']) | def f_local(target, source, env, for_signature, LocalFunc=LocalFunc): return SCons.Action.Action(LocalFunc, varlist=['XYZ']) | 450,386 |
def must_copy(dst, src): if not os.path.exists(dst): return 1 return open(dst, 'rb').read() != open(src, 'rb').read() | def must_copy(dst, src): if not os.path.exists(dst): return 1 return open(dst, 'rb').read() != open(src, 'rb').read() | 450,387 |
def semi_deepcopy(x): copier = _semi_deepcopy_dispatch.get(type(x)) if copier: return copier(x) else: if hasattr(x, '__semi_deepcopy__'): return x.__semi_deepcopy__() elif isinstance(x, UserDict): return x.__class__(_semi_deepcopy_dict(x)) elif isinstance(x, UserList): return x.__class__(_semi_deepcopy_list(x)) return... | def semi_deepcopy(x): copier = _semi_deepcopy_dispatch.get(type(x)) if copier: return copier(x) else: if hasattr(x, '__semi_deepcopy__') and callable(x.__semi_deepcopy__): return x.__semi_deepcopy__() elif isinstance(x, UserDict): return x.__class__(_semi_deepcopy_dict(x)) elif isinstance(x, UserList): return x.__class... | 450,388 |
def find_missing(self): result = [] for dirpath, dirnames, filenames in os.walk(self.directory): for fname in filenames: fpath = os.path.join(dirpath, fname) if self.remove_this(fname, fpath): result.remove(fname) elif self.search_this(fpath): body = open(path, 'r').read() for expr in self.expressions: if not expr.sear... | def find_missing(self): result = [] for dirpath, dirnames, filenames in os.walk(self.directory): for fname in filenames: fpath = os.path.join(dirpath, fname) if self.search_this(fpath) and not self.remove_this(fname, fpath): body = open(fpath, 'r').read() for expr in self.expressions: if not expr.search(body): msg = '%... | 450,389 |
def find_missing(self): result = [] for dirpath, dirnames, filenames in os.walk(self.directory): for fname in filenames: fpath = os.path.join(dirpath, fname) if self.remove_this(fname, fpath): result.remove(fname) elif self.search_this(fpath): body = open(path, 'r').read() for expr in self.expressions: if not expr.sear... | def find_missing(self): result = [] for dirpath, dirnames, filenames in os.walk(self.directory): for fname in filenames: fpath = os.path.join(dirpath, fname) if self.remove_this(fname, fpath): result.remove(fname) elif self.search_this(fpath): body = open(path, 'r').read() for expr in self.expressions: if not expr.sear... | 450,390 |
def find(file, search=search): for dir in search: f = os.path.join(dir, file) if os.path.exists(f): return os.path.normpath(f) sys.stderr.write("could not find `%s' in search path:\n" % file) sys.stderr.write("\t" + "\n\t".join(search) + "\n") sys.exit(2) | def find(file, search=search): for dir in search: f = os.path.join(dir, file) if os.path.exists(f): return os.path.normpath(f) sys.stderr.write("could not find `%s' in search path:\n" % file) sys.stderr.write("\t" + "\n\t".join(search) + "\n") sys.exit(2) | 450,391 |
def get_sdk_vc_script(self,host_arch, target_arch): """ Return the script to initialize the VC compiler installed by SDK """ arch_string=target_arch if (host_arch != target_arch): arch_string='%s_%s'%(host_arch,target_arch) #print "arch_string:%s host_arch:%s target_arch:%s"%(arch_string, # ... | def get_sdk_vc_script(self,host_arch, target_arch): """ Return the script to initialize the VC compiler installed by SDK """ arch_string=target_arch if (host_arch != target_arch): arch_string='%s_%s'%(host_arch,target_arch) #print "arch_string:%s host_arch:%s target_arch:%s"%(arch_string, #debug("sdk.py: get_sdk_vc_s... | 450,392 |
def get_sdk_vc_script(self,host_arch, target_arch): """ Return the script to initialize the VC compiler installed by SDK """ arch_string=target_arch if (host_arch != target_arch): arch_string='%s_%s'%(host_arch,target_arch) #print "arch_string:%s host_arch:%s target_arch:%s"%(arch_string, # ... | defdebug("sdk.py: get_sdk_vc_script():file:%s"%file) get_sdk_vc_script(self,host_arch,debug("sdk.py: get_sdk_vc_script():file:%s"%file) target_arch):debug("sdk.py: get_sdk_vc_script():file:%s"%file) """debug("sdk.py: get_sdk_vc_script():file:%s"%file) Returndebug("sdk.py: get_sdk_vc_script():file:%s"%file) thedebug("sd... | 450,393 |
def get_installed_sdks(): global InstalledSDKList global InstalledSDKMap if InstalledSDKList is None: InstalledSDKList = [] InstalledSDKMap = {} for sdk in SupportedSDKList: debug('trying to find SDK %s' % sdk.version) if sdk.get_sdk_dir(): debug('found SDK %s' % sdk.version) InstalledSDKList.append(sdk) InstalledSDKMa... | def get_installed_sdks(): global InstalledSDKList global InstalledSDKMap if InstalledSDKList is None: InstalledSDKList = [] InstalledSDKMap = {} for sdk in SupportedSDKList: debug('MSCommon/sdk.py: trying to find SDK %s' % sdk.version) if sdk.get_sdk_dir(): debug('found SDK %s' % sdk.version) InstalledSDKList.append(sd... | 450,394 |
def get_installed_sdks(): global InstalledSDKList global InstalledSDKMap if InstalledSDKList is None: InstalledSDKList = [] InstalledSDKMap = {} for sdk in SupportedSDKList: debug('trying to find SDK %s' % sdk.version) if sdk.get_sdk_dir(): debug('found SDK %s' % sdk.version) InstalledSDKList.append(sdk) InstalledSDKMa... | def get_installed_sdks(): global InstalledSDKList global InstalledSDKMap if InstalledSDKList is None: InstalledSDKList = [] InstalledSDKMap = {} for sdk in SupportedSDKList: debug('trying to find SDK %s' % sdk.version) if sdk.get_sdk_dir(): debug('MSCommon/sdk.py:found SDK %s' % sdk.version) InstalledSDKList.append(sdk... | 450,395 |
def __call__(self, target, source, env, *args, **kw): args = (self, target, source, env) + args c = self.get_parent_class(env) #TODO(1.5) return c.__call__(*args, **kw) return c.__call__(*args, **kw) | def __call__(self, target, source, env, *args, **kw): args = (self, target, source, env) + args c = self.get_parent_class(env) #TODO(1.5) return c.__call__(*args, **kw) return c.__call__(*args, **kw) | 450,396 |
def _main(): pass | def _main(): pass | 450,397 |
def _main(): pass | def _main(): pass | 450,398 |
def _main(): pass | def _main(): pass | 450,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.