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/hooks/ClickAndLoad.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index a7862045e..b910902c6 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -10,7 +10,7 @@ except ImportError: from threading import Lock -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded def forward(source, destination): @@ -29,7 +29,7 @@ def forward(source, destination): class ClickAndLoad(Hook): __name__ = "ClickAndLoad" __type__ = "hook" - __version__ = "0.43" + __version__ = "0.44" __config__ = [("activated", "bool", "Activated" , True), ("port" , "int" , "Port" , 9666), -- cgit v1.2.3 From c9144f451b74e4d3cc67935b9e73c662ac870c6e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 07:18:39 +0200 Subject: Hook plugin code cosmetics (2) --- module/plugins/hooks/ClickAndLoad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index b910902c6..e9e231a28 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -48,7 +48,7 @@ class ClickAndLoad(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def coreReady(self): + def activate(self): if not self.config['webinterface']['activated']: return -- cgit v1.2.3 From 5a139055ae658d3a05cbb658cbd66aeae0d01db5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 21:06:10 +0200 Subject: Spare code cosmetics --- module/plugins/hooks/ClickAndLoad.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index e9e231a28..81a446ef3 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -49,11 +49,11 @@ class ClickAndLoad(Hook): def activate(self): - if not self.config['webinterface']['activated']: + if not self.core.config['webinterface']['activated']: return ip = "" if self.getConfig('extern') else "127.0.0.1" - webport = self.config['webinterface']['port'] + webport = self.core.config['webinterface']['port'] cnlport = self.getConfig('port') self.proxy(ip, webport, cnlport) @@ -85,7 +85,7 @@ class ClickAndLoad(Hook): server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if self.config['webinterface']['https']: + if self.core.config['webinterface']['https']: try: server_socket = ssl.wrap_socket(server_socket) -- cgit v1.2.3 From 164512b6a74c94a731fcee7435dce1ccfa2f71e7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:29:50 +0200 Subject: Spare code cosmetics --- module/plugins/hooks/ClickAndLoad.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 81a446ef3..f7431ebac 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -49,11 +49,11 @@ class ClickAndLoad(Hook): def activate(self): - if not self.core.config['webinterface']['activated']: + if not self.core.config.get("webinterface", "activated"): return ip = "" if self.getConfig('extern') else "127.0.0.1" - webport = self.core.config['webinterface']['port'] + webport = self.core.config.get("webinterface", "port") cnlport = self.getConfig('port') self.proxy(ip, webport, cnlport) @@ -85,7 +85,7 @@ class ClickAndLoad(Hook): server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if self.core.config['webinterface']['https']: + if self.core.config.get("webinterface", "https"): try: server_socket = ssl.wrap_socket(server_socket) -- 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/hooks/ClickAndLoad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index f7431ebac..b1009420a 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -22,7 +22,7 @@ def forward(source, destination): bufdata = source.recv(bufsize) finally: destination.shutdown(socket.SHUT_WR) - # destination.close() + #: destination.close() #@TODO: IPv6 support -- 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/hooks/ClickAndLoad.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index b1009420a..109452105 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -29,7 +29,7 @@ def forward(source, destination): class ClickAndLoad(Hook): __name__ = "ClickAndLoad" __type__ = "hook" - __version__ = "0.44" + __version__ = "0.45" __config__ = [("activated", "bool", "Activated" , True), ("port" , "int" , "Port" , 9666), @@ -52,9 +52,9 @@ class ClickAndLoad(Hook): if not self.core.config.get("webinterface", "activated"): return - ip = "" if self.getConfig('extern') else "127.0.0.1" + ip = "" if self.get_config('extern') else "127.0.0.1" webport = self.core.config.get("webinterface", "port") - cnlport = self.getConfig('port') + cnlport = self.get_config('port') self.proxy(ip, webport, cnlport) @@ -63,7 +63,7 @@ class ClickAndLoad(Hook): def proxy(self, ip, webport, cnlport): time.sleep(10) #@TODO: Remove in 0.4.10 (implement addon delay on startup) - self.logInfo(_("Proxy listening on %s:%s") % (ip or "0.0.0.0", cnlport)) + self.log_info(_("Proxy listening on %s:%s") % (ip or "0.0.0.0", cnlport)) self._server(ip, webport, cnlport) @@ -81,7 +81,7 @@ class ClickAndLoad(Hook): while True: client_socket, client_addr = dock_socket.accept() - self.logDebug("Connection from %s:%s" % client_addr) + self.log_debug("Connection from %s:%s" % client_addr) server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -90,12 +90,12 @@ class ClickAndLoad(Hook): server_socket = ssl.wrap_socket(server_socket) except NameError: - self.logError(_("pyLoad's webinterface is configured to use HTTPS, Please install python's ssl lib or disable HTTPS")) + self.log_error(_("pyLoad's webinterface is configured to use HTTPS, Please install python's ssl lib or disable HTTPS")) client_socket.close() #: reset the connection. continue except Exception, e: - self.logError(_("SSL error: %s") % e.message) + self.log_error(_("SSL error: %s") % e.message) client_socket.close() #: reset the connection. continue @@ -105,10 +105,10 @@ class ClickAndLoad(Hook): self.manager.startThread(forward, server_socket, client_socket) except socket.timeout: - self.logDebug("Connection timed out, retrying...") + self.log_debug("Connection timed out, retrying...") return self._server(ip, webport, cnlport) except socket.error, e: - self.logError(e) + self.log_error(e) time.sleep(240) return self._server(ip, webport, cnlport) -- 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/hooks/ClickAndLoad.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 109452105..c361d51b2 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -91,12 +91,12 @@ class ClickAndLoad(Hook): except NameError: self.log_error(_("pyLoad's webinterface is configured to use HTTPS, Please install python's ssl lib or disable HTTPS")) - client_socket.close() #: reset the connection. + client_socket.close() #: Reset the connection. continue except Exception, e: self.log_error(_("SSL error: %s") % e.message) - client_socket.close() #: reset the connection. + client_socket.close() #: Reset the connection. continue server_socket.connect(("127.0.0.1", webport)) -- cgit v1.2.3 From 502517f37c7540b0bddb092e69386d9d6f08800c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 09:42:34 +0200 Subject: Fix addons --- module/plugins/hooks/ClickAndLoad.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index c361d51b2..61e28f469 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -10,7 +10,7 @@ except ImportError: from threading import Lock -from module.plugins.internal.Hook import Hook, threaded +from module.plugins.internal.Addon import Addon, threaded def forward(source, destination): @@ -26,7 +26,7 @@ def forward(source, destination): #@TODO: IPv6 support -class ClickAndLoad(Hook): +class ClickAndLoad(Addon): __name__ = "ClickAndLoad" __type__ = "hook" __version__ = "0.45" @@ -41,13 +41,6 @@ class ClickAndLoad(Hook): ("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def activate(self): if not self.core.config.get("webinterface", "activated"): return -- 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/hooks/ClickAndLoad.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 61e28f469..f6c226225 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -42,11 +42,11 @@ class ClickAndLoad(Addon): def activate(self): - if not self.core.config.get("webinterface", "activated"): + if not self.pyload.config.get("webinterface", "activated"): return ip = "" if self.get_config('extern') else "127.0.0.1" - webport = self.core.config.get("webinterface", "port") + webport = self.pyload.config.get("webinterface", "port") cnlport = self.get_config('port') self.proxy(ip, webport, cnlport) @@ -78,7 +78,7 @@ class ClickAndLoad(Addon): server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if self.core.config.get("webinterface", "https"): + if self.pyload.config.get("webinterface", "https"): try: server_socket = ssl.wrap_socket(server_socket) -- 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/hooks/ClickAndLoad.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index f6c226225..a294c3d4d 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -30,6 +30,7 @@ class ClickAndLoad(Addon): __name__ = "ClickAndLoad" __type__ = "hook" __version__ = "0.45" + __status__ = "stable" __config__ = [("activated", "bool", "Activated" , True), ("port" , "int" , "Port" , 9666), -- 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/hooks/ClickAndLoad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/ClickAndLoad.py') diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index a294c3d4d..ba03129e6 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -30,7 +30,7 @@ class ClickAndLoad(Addon): __name__ = "ClickAndLoad" __type__ = "hook" __version__ = "0.45" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True), ("port" , "int" , "Port" , 9666), -- cgit v1.2.3