From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/accounts/FilecloudIo.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index f2becb8c9..a45eb3288 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ from module.plugins.Account import Account -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/accounts/FilecloudIo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index a45eb3288..17eda5ae3 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -48,7 +48,7 @@ class FilecloudIo(Account): rep = json_loads(rep) if rep['is_premium'] == 1: - return {"validuntil": int(rep["premium_until"]), "trafficleft": -1} + return {"validuntil": int(rep['premium_until']), "trafficleft": -1} else: return {"premium": False} @@ -59,8 +59,8 @@ class FilecloudIo(Account): if not hasattr(self, "form_data"): self.form_data = {} - self.form_data["username"] = user - self.form_data["password"] = data['password'] + self.form_data['username'] = user + self.form_data['password'] = data['password'] html = req.load('https://secure.filecloud.io/user-login_p.html', post=self.form_data, -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/accounts/FilecloudIo.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index 17eda5ae3..b8bad5c4c 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -23,10 +23,12 @@ class FilecloudIo(Account): __name__ = "FilecloudIo" __version__ = "0.02" __type__ = "account" + __description__ = """FilecloudIo account plugin""" __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + def loadAccountInfo(self, user, req): # It looks like the first API request always fails, so we retry 5 times, it should work on the second try for _ in xrange(5): -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/accounts/FilecloudIo.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index b8bad5c4c..ec98cf9b2 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -1,28 +1,13 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - from module.plugins.Account import Account from module.common.json_layer import json_loads class FilecloudIo(Account): __name__ = "FilecloudIo" - __version__ = "0.02" __type__ = "account" + __version__ = "0.02" __description__ = """FilecloudIo account plugin""" __author_name__ = ("zoidberg", "stickell") -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/accounts/FilecloudIo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index ec98cf9b2..ffc427bcd 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -10,8 +10,8 @@ class FilecloudIo(Account): __version__ = "0.02" __description__ = """FilecloudIo account plugin""" - __author_name__ = ("zoidberg", "stickell") - __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] def loadAccountInfo(self, user, req): -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/accounts/FilecloudIo.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index ffc427bcd..364f349da 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -10,6 +10,7 @@ class FilecloudIo(Account): __version__ = "0.02" __description__ = """FilecloudIo account plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("stickell", "l.stickell@yahoo.it")] -- cgit v1.2.3 From 6a0fb7fdd4ea2749be44625225d8a235a78f032f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:42:39 +0200 Subject: [accounts] Code cosmetics --- module/plugins/accounts/FilecloudIo.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index 364f349da..439491ea9 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -40,6 +40,7 @@ class FilecloudIo(Account): else: return {"premium": False} + def login(self, user, data, req): req.cj.setCookie("secure.filecloud.io", "lang", "en") html = req.load('https://secure.filecloud.io/user-login.html') -- cgit v1.2.3 From 1c4bf83881d2a22da3773666a580d51f6b57bfd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 03:07:21 +0200 Subject: Avoid gettext conflict due variable `_` --- module/plugins/accounts/FilecloudIo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index 439491ea9..e1f8c0142 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -17,7 +17,7 @@ class FilecloudIo(Account): def loadAccountInfo(self, user, req): # It looks like the first API request always fails, so we retry 5 times, it should work on the second try - for _ in xrange(5): + for _i in xrange(5): rep = req.load("https://secure.filecloud.io/api-fetch_apikey.api", post={"username": user, "password": self.accounts[user]['password']}) rep = json_loads(rep) -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/accounts/FilecloudIo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index e1f8c0142..c889c9644 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -24,7 +24,7 @@ class FilecloudIo(Account): if rep['status'] == 'ok': break elif rep['status'] == 'error' and rep['message'] == 'no such user or wrong password': - self.logError("Wrong username or password") + self.logError(_("Wrong username or password")) return {"valid": False, "premium": False} else: return {"premium": False} -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/accounts/FilecloudIo.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index c889c9644..c001d4513 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -5,14 +5,14 @@ from module.common.json_layer import json_loads class FilecloudIo(Account): - __name__ = "FilecloudIo" - __type__ = "account" + __name__ = "FilecloudIo" + __type__ = "account" __version__ = "0.02" __description__ = """FilecloudIo account plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it")] def loadAccountInfo(self, user, req): -- cgit v1.2.3 From c9e31d875d32de31e54959b82bc35eff2b3e0f3f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 10 Nov 2014 00:19:51 +0100 Subject: Code cosmetics --- module/plugins/accounts/FilecloudIo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index c001d4513..f62d95301 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -42,7 +42,7 @@ class FilecloudIo(Account): def login(self, user, data, req): - req.cj.setCookie("secure.filecloud.io", "lang", "en") + req.cj.setCookie(".secure.filecloud.io", "lang", "en") html = req.load('https://secure.filecloud.io/user-login.html') if not hasattr(self, "form_data"): -- cgit v1.2.3 From e8246525f3106c152d6d1436c6a3111e0334520f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 18:04:47 +0100 Subject: Fix cookie domain --- module/plugins/accounts/FilecloudIo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index f62d95301..c001d4513 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -42,7 +42,7 @@ class FilecloudIo(Account): def login(self, user, data, req): - req.cj.setCookie(".secure.filecloud.io", "lang", "en") + req.cj.setCookie("secure.filecloud.io", "lang", "en") html = req.load('https://secure.filecloud.io/user-login.html') if not hasattr(self, "form_data"): -- cgit v1.2.3 From fb65d5354c3cc80c3f48c3a2745b8dc01105edfd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 16:02:29 +0100 Subject: Update account plugins --- module/plugins/accounts/FilecloudIo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/FilecloudIo.py') diff --git a/module/plugins/accounts/FilecloudIo.py b/module/plugins/accounts/FilecloudIo.py index c001d4513..d20f756f3 100644 --- a/module/plugins/accounts/FilecloudIo.py +++ b/module/plugins/accounts/FilecloudIo.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class FilecloudIo(Account): __name__ = "FilecloudIo" __type__ = "account" - __version__ = "0.02" + __version__ = "0.03" __description__ = """FilecloudIo account plugin""" __license__ = "GPLv3" @@ -36,7 +36,7 @@ class FilecloudIo(Account): rep = json_loads(rep) if rep['is_premium'] == 1: - return {"validuntil": int(rep['premium_until']), "trafficleft": -1} + return {"validuntil": float(rep['premium_until']), "trafficleft": -1} else: return {"premium": False} -- cgit v1.2.3