From 6283481a29e49776703ce6688b3e4fcb5dd11bf2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 04:02:12 +0200 Subject: [FreeWayMe] Fixup --- module/plugins/accounts/FreeWayMe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/FreeWayMe.py') diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 14b9f1e9a..7993a485e 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class FreeWayMe(Account): __name__ = "FreeWayMe" __type__ = "account" - __version__ = "0.13" + __version__ = "0.14" __description__ = """FreeWayMe account plugin""" __license__ = "GPLv3" @@ -41,7 +41,7 @@ class FreeWayMe(Account): def getAccountStatus(self, user, req): - answer = req.load("https://www.free-way.me/ajax/jd.php", + answer = req.load("http://www.free-way.bz/ajax/jd.php", #@TODO: Revert to `https` in 0.4.10 get={"id": 4, "user": user, "pass": self.getAccountData(user)['password']}) self.logDebug("Login: %s" % answer) -- cgit v1.2.3 From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/accounts/FreeWayMe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/FreeWayMe.py') diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 7993a485e..66f93e0bb 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- -from module.plugins.Account import Account +from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class FreeWayMe(Account): __name__ = "FreeWayMe" __type__ = "account" - __version__ = "0.14" + __version__ = "0.15" __description__ = """FreeWayMe account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/accounts/FreeWayMe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FreeWayMe.py') diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 66f93e0bb..5a1f75bf6 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -41,7 +41,7 @@ class FreeWayMe(Account): def getAccountStatus(self, user, req): - answer = req.load("http://www.free-way.bz/ajax/jd.php", #@TODO: Revert to `https` in 0.4.10 + answer = self.load("http://www.free-way.bz/ajax/jd.php", #@TODO: Revert to `https` in 0.4.10 get={"id": 4, "user": user, "pass": self.getAccountData(user)['password']}) self.logDebug("Login: %s" % answer) -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/accounts/FreeWayMe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FreeWayMe.py') diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 5a1f75bf6..b9a0acea7 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -35,7 +35,7 @@ class FreeWayMe(Account): def login(self, user, data, req): status = self.getAccountStatus(user, req) - # Check if user and password are valid + #: Check if user and password are valid if not status: self.wrongPassword() -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/accounts/FreeWayMe.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'module/plugins/accounts/FreeWayMe.py') diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index b9a0acea7..95977bd0f 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -7,21 +7,21 @@ from module.common.json_layer import json_loads class FreeWayMe(Account): __name__ = "FreeWayMe" __type__ = "account" - __version__ = "0.15" + __version__ = "0.16" __description__ = """FreeWayMe account plugin""" __license__ = "GPLv3" __authors__ = [("Nicolas Giese", "james@free-way.me")] - def loadAccountInfo(self, user, req): - status = self.getAccountStatus(user, req) + def load_account_info(self, user, req): + status = self.get_account_status(user, req) - self.logDebug(status) + self.log_debug(status) account_info = {"validuntil": -1, "premium": False} if status['premium'] == "Free": - account_info['trafficleft'] = self.parseTraffic(status['guthaben'] + "MB") + account_info['trafficleft'] = self.parse_traffic(status['guthaben'] + "MB") elif status['premium'] == "Spender": account_info['trafficleft'] = -1 elif status['premium'] == "Flatrate": @@ -33,20 +33,20 @@ class FreeWayMe(Account): def login(self, user, data, req): - status = self.getAccountStatus(user, req) + status = self.get_account_status(user, req) #: Check if user and password are valid if not status: - self.wrongPassword() + self.wrong_password() - def getAccountStatus(self, user, req): + def get_account_status(self, user, req): answer = self.load("http://www.free-way.bz/ajax/jd.php", #@TODO: Revert to `https` in 0.4.10 - get={"id": 4, "user": user, "pass": self.getAccountData(user)['password']}) + get={"id": 4, "user": user, "pass": self.get_account_data(user)['password']}) - self.logDebug("Login: %s" % answer) + self.log_debug("Login: %s" % answer) if answer == "Invalid login": - self.wrongPassword() + self.wrong_password() return json_loads(answer) -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/accounts/FreeWayMe.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FreeWayMe.py') diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 95977bd0f..2b54a850a 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -19,15 +19,15 @@ class FreeWayMe(Account): self.log_debug(status) - account_info = {"validuntil": -1, "premium": False} + account_info = {'validuntil': -1, 'premium': False} if status['premium'] == "Free": account_info['trafficleft'] = self.parse_traffic(status['guthaben'] + "MB") elif status['premium'] == "Spender": account_info['trafficleft'] = -1 elif status['premium'] == "Flatrate": - account_info = {"validuntil": float(status['Flatrate']), - "trafficleft": -1, - "premium": True} + account_info = {'validuntil' : float(status['Flatrate']), + 'trafficleft': -1, + 'premium' : True} return account_info @@ -42,7 +42,7 @@ class FreeWayMe(Account): def get_account_status(self, user, req): answer = self.load("http://www.free-way.bz/ajax/jd.php", #@TODO: Revert to `https` in 0.4.10 - get={"id": 4, "user": user, "pass": self.get_account_data(user)['password']}) + get={'id': 4, 'user': user, 'pass': self.get_account_data(user)['password']}) self.log_debug("Login: %s" % answer) -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/accounts/FreeWayMe.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/FreeWayMe.py') diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index 2b54a850a..a0795c7d6 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -8,6 +8,7 @@ class FreeWayMe(Account): __name__ = "FreeWayMe" __type__ = "account" __version__ = "0.16" + __status__ = "stable" __description__ = """FreeWayMe account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/accounts/FreeWayMe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FreeWayMe.py') diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index a0795c7d6..b370439d0 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -8,7 +8,7 @@ class FreeWayMe(Account): __name__ = "FreeWayMe" __type__ = "account" __version__ = "0.16" - __status__ = "stable" + __status__ = "testing" __description__ = """FreeWayMe account plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- module/plugins/accounts/FreeWayMe.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FreeWayMe.py') diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index b370439d0..bfb2747cb 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -15,7 +15,7 @@ class FreeWayMe(Account): __authors__ = [("Nicolas Giese", "james@free-way.me")] - def load_account_info(self, user, req): + def parse_info(self, user, password, data, req): status = self.get_account_status(user, req) self.log_debug(status) @@ -33,21 +33,21 @@ class FreeWayMe(Account): return account_info - def login(self, user, data, req): + def login(self, user, password, data, req): status = self.get_account_status(user, req) #: Check if user and password are valid if not status: - self.wrong_password() + self.fail() def get_account_status(self, user, req): answer = self.load("http://www.free-way.bz/ajax/jd.php", #@TODO: Revert to `https` in 0.4.10 - get={'id': 4, 'user': user, 'pass': self.get_account_data(user)['password']}) + get={'id': 4, 'user': user, 'pass': self.get_data(user)['password']}) self.log_debug("Login: %s" % answer) if answer == "Invalid login": - self.wrong_password() + self.fail() return json_loads(answer) -- cgit v1.2.3 From a95c217627a1cb651b24e69f20640df40797aff9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 09:34:18 +0200 Subject: Account rewritten (2) --- module/plugins/accounts/FreeWayMe.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/accounts/FreeWayMe.py') diff --git a/module/plugins/accounts/FreeWayMe.py b/module/plugins/accounts/FreeWayMe.py index bfb2747cb..0c315873f 100644 --- a/module/plugins/accounts/FreeWayMe.py +++ b/module/plugins/accounts/FreeWayMe.py @@ -16,7 +16,7 @@ class FreeWayMe(Account): def parse_info(self, user, password, data, req): - status = self.get_account_status(user, req) + status = self.get_account_status(user, password, req) self.log_debug(status) @@ -34,20 +34,20 @@ class FreeWayMe(Account): def login(self, user, password, data, req): - status = self.get_account_status(user, req) + status = self.get_account_status(user, password, req) #: Check if user and password are valid if not status: - self.fail() + self.login_fail() - def get_account_status(self, user, req): + def get_account_status(self, user, password, req): answer = self.load("http://www.free-way.bz/ajax/jd.php", #@TODO: Revert to `https` in 0.4.10 - get={'id': 4, 'user': user, 'pass': self.get_data(user)['password']}) + get={'id': 4, 'user': user, 'pass': password}) self.log_debug("Login: %s" % answer) if answer == "Invalid login": - self.fail() + self.login_fail() return json_loads(answer) -- cgit v1.2.3