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/hoster/Ftp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 295955cbe..adfb279e4 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -5,13 +5,13 @@ import re import urllib import urlparse -from module.plugins.Hoster import Hoster +from module.plugins.internal.Hoster import Hoster class Ftp(Hoster): __name__ = "Ftp" __type__ = "hoster" - __version__ = "0.52" + __version__ = "0.53" __pattern__ = r'(?:ftps?|sftp)://([\w.-]+(:[\w.-]+)?@)?[\w.-]+(:\d+)?/.+' -- 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/hoster/Ftp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index adfb279e4..2e10de971 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -70,7 +70,7 @@ class Ftp(Hoster): pyfile.url += '/' self.req.http.c.setopt(48, 1) # CURLOPT_DIRLISTONLY res = self.load(pyfile.url, decode=False) - links = [pyfile.url + urllib.quote(x) for x in res.splitlines()] + links = [pyfile.url + x for x in res.splitlines()] self.logDebug("LINKS", links) self.core.api.addPackage(pkgname, links) else: -- 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/hoster/Ftp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 2e10de971..f4d6380ee 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -68,7 +68,7 @@ class Ftp(Hoster): pyfile.url = pyfile.url.rstrip('/') pkgname = "/".join([pyfile.package().name, urlparse.urlparse(pyfile.url).path.rpartition('/')[2]]) pyfile.url += '/' - self.req.http.c.setopt(48, 1) # CURLOPT_DIRLISTONLY + self.req.http.c.setopt(48, 1) #: CURLOPT_DIRLISTONLY res = self.load(pyfile.url, decode=False) links = [pyfile.url + x for x in res.splitlines()] self.logDebug("LINKS", links) -- 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/hoster/Ftp.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index f4d6380ee..8c269b255 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -11,7 +11,7 @@ from module.plugins.internal.Hoster import Hoster class Ftp(Hoster): __name__ = "Ftp" __type__ = "hoster" - __version__ = "0.53" + __version__ = "0.54" __pattern__ = r'(?:ftps?|sftp)://([\w.-]+(:[\w.-]+)?@)?[\w.-]+(:\d+)?/.+' @@ -23,8 +23,8 @@ class Ftp(Hoster): def setup(self): - self.chunkLimit = -1 - self.resumeDownload = True + self.chunk_limit = -1 + self.resume_download = True def process(self, pyfile): @@ -41,10 +41,10 @@ class Ftp(Hoster): servers = [x['login'] for x in self.account.getAllAccounts()] if self.account else [] if netloc in servers: - self.logDebug("Logging on to %s" % netloc) + self.log_debug("Logging on to %s" % netloc) self.req.addAuth(self.account.getAccountInfo(netloc)['password']) else: - pwd = self.getPassword() + pwd = self.get_password() if ':' in pwd: self.req.addAuth(pwd) @@ -56,14 +56,14 @@ class Ftp(Hoster): self.fail(_("Error %d: %s") % e.args) self.req.http.c.setopt(pycurl.NOBODY, 0) - self.logDebug(self.req.http.header) + self.log_debug(self.req.http.header) m = re.search(r"Content-Length:\s*(\d+)", res) if m: pyfile.size = int(m.group(1)) self.download(pyfile.url) else: - #Naive ftp directory listing + # Naive ftp directory listing if re.search(r'^25\d.*?"', self.req.http.header, re.M): pyfile.url = pyfile.url.rstrip('/') pkgname = "/".join([pyfile.package().name, urlparse.urlparse(pyfile.url).path.rpartition('/')[2]]) @@ -71,7 +71,7 @@ class Ftp(Hoster): self.req.http.c.setopt(48, 1) #: CURLOPT_DIRLISTONLY res = self.load(pyfile.url, decode=False) links = [pyfile.url + x for x in res.splitlines()] - self.logDebug("LINKS", links) + self.log_debug("LINKS", links) self.core.api.addPackage(pkgname, links) else: self.fail(_("Unexpected server response")) -- cgit v1.2.3 From d2e2b127651a5a44b56337eb6d9ca246c97a208a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/hoster/Ftp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 8c269b255..2accf9883 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -38,11 +38,11 @@ class Ftp(Hoster): pass if not "@" in netloc: - servers = [x['login'] for x in self.account.getAllAccounts()] if self.account else [] + servers = [x['login'] for x in self.account.get_all_accounts()] if self.account else [] if netloc in servers: self.log_debug("Logging on to %s" % netloc) - self.req.addAuth(self.account.getAccountInfo(netloc)['password']) + self.req.addAuth(self.account.get_account_info(netloc)['password']) else: pwd = self.get_password() if ':' in pwd: -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- module/plugins/hoster/Ftp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 2accf9883..685e7ce87 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -63,7 +63,7 @@ class Ftp(Hoster): pyfile.size = int(m.group(1)) self.download(pyfile.url) else: - # Naive ftp directory listing + #: Naive ftp directory listing if re.search(r'^25\d.*?"', self.req.http.header, re.M): pyfile.url = pyfile.url.rstrip('/') pkgname = "/".join([pyfile.package().name, urlparse.urlparse(pyfile.url).path.rpartition('/')[2]]) -- cgit v1.2.3 From 56389e28ba5d2f5658278bc7f486d73be747f135 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 11:44:49 +0200 Subject: Rename self.core to self.pyload (plugins only) --- module/plugins/hoster/Ftp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 685e7ce87..27ebed842 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -72,6 +72,6 @@ class Ftp(Hoster): res = self.load(pyfile.url, decode=False) links = [pyfile.url + x for x in res.splitlines()] self.log_debug("LINKS", links) - self.core.api.addPackage(pkgname, links) + self.pyload.api.addPackage(pkgname, links) else: self.fail(_("Unexpected server response")) -- 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/hoster/Ftp.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 27ebed842..dbb6a508c 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -12,6 +12,7 @@ class Ftp(Hoster): __name__ = "Ftp" __type__ = "hoster" __version__ = "0.54" + __status__ = "stable" __pattern__ = r'(?:ftps?|sftp)://([\w.-]+(:[\w.-]+)?@)?[\w.-]+(:\d+)?/.+' -- 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/hoster/Ftp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index dbb6a508c..b431198d5 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -12,7 +12,7 @@ class Ftp(Hoster): __name__ = "Ftp" __type__ = "hoster" __version__ = "0.54" - __status__ = "stable" + __status__ = "testing" __pattern__ = r'(?:ftps?|sftp)://([\w.-]+(:[\w.-]+)?@)?[\w.-]+(:\d+)?/.+' -- 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/hoster/Ftp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index b431198d5..99185338f 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -39,11 +39,11 @@ class Ftp(Hoster): pass if not "@" in netloc: - servers = [x['login'] for x in self.account.get_all_accounts()] if self.account else [] + servers = [x['login'] for x in self.account.getAllAccounts()] if self.account else [] if netloc in servers: self.log_debug("Logging on to %s" % netloc) - self.req.addAuth(self.account.get_account_info(netloc)['password']) + self.req.addAuth(self.account.get_data(netloc)['password']) else: pwd = self.get_password() if ':' in pwd: -- 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/hoster/Ftp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/Ftp.py') diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index 99185338f..25eb44604 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -43,7 +43,7 @@ class Ftp(Hoster): if netloc in servers: self.log_debug("Logging on to %s" % netloc) - self.req.addAuth(self.account.get_data(netloc)['password']) + self.req.addAuth(self.account.get_info(netloc)['login']['password']) else: pwd = self.get_password() if ':' in pwd: -- cgit v1.2.3