From 3956327aa3ba0db902bfcf079420642fb7d2546d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 18 Jan 2012 07:07:11 +0000 Subject: Fix Oron Account plugin `loadAccountInfo` signature --- module/plugins/accounts/OronCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/OronCom.py') diff --git a/module/plugins/accounts/OronCom.py b/module/plugins/accounts/OronCom.py index 793984121..174b5a0d9 100755 --- a/module/plugins/accounts/OronCom.py +++ b/module/plugins/accounts/OronCom.py @@ -23,13 +23,13 @@ from time import strptime, mktime class OronCom(Account): __name__ = "OronCom" - __version__ = "0.12" + __version__ = "0.13" __type__ = "account" __description__ = """oron.com account plugin""" __author_name__ = ("DHMH") __author_mail__ = ("DHMH@pyload.org") - def loadAccountInfo(self, user, req): + def loadAccountInfo(self, req): req.load("http://oron.com/?op=change_lang&lang=german") src = req.load("http://oron.com/?op=my_account").replace("\n", "") validuntil = re.search(r"Premiumaccount läuft bis:\s*(.*?)", src) @@ -52,3 +52,4 @@ class OronCom(Account): page = req.load("http://oron.com/login", post={"login": user, "password": data["password"], "op": "login"}) if r'Login oder Passwort falsch' in page: self.wrongPassword() + -- cgit v1.2.3 From 16fedaf731b2e6000f316948d1d8655b5a927d98 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 18 Jan 2012 07:10:06 +0000 Subject: Also fix `login` on the Oron Account plugin. --- module/plugins/accounts/OronCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/OronCom.py') diff --git a/module/plugins/accounts/OronCom.py b/module/plugins/accounts/OronCom.py index 174b5a0d9..2b4f8bdb3 100755 --- a/module/plugins/accounts/OronCom.py +++ b/module/plugins/accounts/OronCom.py @@ -47,9 +47,9 @@ class OronCom(Account): tmp = {"validuntil": validuntil, "trafficleft": trafficleft, "premium" : premium} return tmp - def login(self, user, data, req): + def login(self, data, req): req.load("http://oron.com/?op=change_lang&lang=german") - page = req.load("http://oron.com/login", post={"login": user, "password": data["password"], "op": "login"}) + page = req.load("http://oron.com/login", post={"login": self.loginname, "password": data["password"], "op": "login"}) if r'Login oder Passwort falsch' in page: self.wrongPassword() -- cgit v1.2.3 From 8d7171144bb4cca26797ee8dcfc2a3af25eaceca Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 18 Jan 2012 07:16:02 +0000 Subject: Fix FileSonic and Oron account plugins deprecated method signatures. --- module/plugins/accounts/OronCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/OronCom.py') diff --git a/module/plugins/accounts/OronCom.py b/module/plugins/accounts/OronCom.py index 2b4f8bdb3..1fe8a4449 100755 --- a/module/plugins/accounts/OronCom.py +++ b/module/plugins/accounts/OronCom.py @@ -47,9 +47,9 @@ class OronCom(Account): tmp = {"validuntil": validuntil, "trafficleft": trafficleft, "premium" : premium} return tmp - def login(self, data, req): + def login(self, req): req.load("http://oron.com/?op=change_lang&lang=german") - page = req.load("http://oron.com/login", post={"login": self.loginname, "password": data["password"], "op": "login"}) + page = req.load("http://oron.com/login", post={"login": self.loginname, "password": self.password, "op": "login"}) if r'Login oder Passwort falsch' in page: self.wrongPassword() -- cgit v1.2.3 From a0ebf8d7a70fde61c754af2f146abc3d9b3511f9 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 4 Feb 2012 03:06:15 +0000 Subject: Add helper method `formatTrafficleft()` to `module.plugins.Account`. Regarding Oron account and hoster plugins, make use of `formatSize`, `parseFileSize` and the `Account`'s `formatTrafficleft()` helper method. --- module/plugins/accounts/OronCom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins/accounts/OronCom.py') diff --git a/module/plugins/accounts/OronCom.py b/module/plugins/accounts/OronCom.py index 1fe8a4449..2c1d33162 100755 --- a/module/plugins/accounts/OronCom.py +++ b/module/plugins/accounts/OronCom.py @@ -20,6 +20,7 @@ from module.plugins.Account import Account import re from time import strptime, mktime +from module.utils import formatSize, parseFileSize class OronCom(Account): __name__ = "OronCom" @@ -37,7 +38,7 @@ class OronCom(Account): validuntil = validuntil.group(1) validuntil = int(mktime(strptime(validuntil, "%d %B %Y"))) trafficleft = re.search(r'Download Traffic verfügbar:\s*(.*?)', src).group(1) - self.logDebug("Oron left: " + trafficleft) + self.logDebug("Oron left: " + formatSize(parseFileSize(trafficleft))) trafficleft = int(self.parseTraffic(trafficleft)) premium = True else: -- cgit v1.2.3