diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-07 01:23:55 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-07-07 01:23:55 +0200 |
commit | b1759bc440cd6013837697eb8de540914f693ffd (patch) | |
tree | d170caf63d7f65e44d23ea2d91a65759a1665928 /module/plugins/hoster/BasePlugin.py | |
parent | [Plugin] Fix decoding in load method (diff) | |
download | pyload-b1759bc440cd6013837697eb8de540914f693ffd.tar.xz |
No camelCase style anymore
Diffstat (limited to 'module/plugins/hoster/BasePlugin.py')
-rw-r--r-- | module/plugins/hoster/BasePlugin.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 82311dd6b..7fc0426ea 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -12,7 +12,7 @@ from module.plugins.internal.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.44" + __version__ = "0.45" __pattern__ = r'^unmatchable$' @@ -23,7 +23,7 @@ class BasePlugin(Hoster): @classmethod - def getInfo(cls, url="", html=""): #@TODO: Move to hoster class in 0.4.10 + def get_info(cls, url="", html=""): #@TODO: Move to hoster class in 0.4.10 url = urllib.unquote(url) url_p = urlparse.urlparse(url) return {'name' : (url_p.path.split('/')[-1] @@ -35,23 +35,23 @@ class BasePlugin(Hoster): def setup(self): - self.chunkLimit = -1 - self.multiDL = True - self.resumeDownload = True + self.chunk_limit = -1 + self.multi_dl = True + self.resume_download = True def process(self, pyfile): """ Main function """ - pyfile.name = self.getInfo(pyfile.url)['name'] + pyfile.name = self.get_info(pyfile.url)['name'] if not pyfile.url.startswith("http"): self.fail(_("No plugin matched")) for _i in xrange(5): try: - link = self.directLink(self, urllib.unquote(pyfile.url)) + link = self.direct_link(self, urllib.unquote(pyfile.url)) if link: self.download(link, ref=False, disposition=True) @@ -63,17 +63,17 @@ class BasePlugin(Hoster): self.offline() elif e.code in (401, 403): - self.logDebug("Auth required", "Received HTTP status code: %d" % e.code) + self.log_debug("Auth required", "Received HTTP status code: %d" % e.code) account = self.core.accountManager.getAccountPlugin('Http') servers = [x['login'] for x in account.getAllAccounts()] server = urlparse.urlparse(pyfile.url).netloc if server in servers: - self.logDebug("Logging on to %s" % server) + self.log_debug("Logging on to %s" % server) self.req.addAuth(account.getAccountData(server)['password']) else: - pwd = self.getPassword() + pwd = self.get_password() if ':' in pwd: self.req.addAuth(pwd) else: @@ -85,7 +85,7 @@ class BasePlugin(Hoster): else: self.fail(_("No file downloaded")) #@TODO: Move to hoster class in 0.4.10 - errmsg = self.checkDownload({'Empty file' : re.compile(r'\A\s*\Z'), + errmsg = self.check_download({'Empty file' : re.compile(r'\A\s*\Z'), 'Html error' : re.compile(r'\A(?:\s*<.+>)?((?:[\w\s]*(?:[Ee]rror|ERROR)\s*\:?)?\s*\d{3})(?:\Z|\s+)'), 'Html file' : re.compile(r'\A\s*<!DOCTYPE html'), 'Request error': re.compile(r'([Aa]n error occured while processing your request)')}) @@ -93,11 +93,11 @@ class BasePlugin(Hoster): return try: - errmsg += " | " + self.lastCheck.group(1).strip() + errmsg += " | " + self.last_check.group(1).strip() except Exception: pass - self.logWarning("Check result: " + errmsg, "Waiting 1 minute and retry") + self.log_warning("Check result: " + errmsg, "Waiting 1 minute and retry") self.retry(3, 60, errmsg) |