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/WindowsPhoneNotify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/WindowsPhoneNotify.py') diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 8f66761f6..dfc93f89c 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -3,13 +3,13 @@ import httplib import time -from module.plugins.Hook import Hook, Expose +from module.plugins.internal.Hook import Hook, Expose class WindowsPhoneNotify(Hook): __name__ = "WindowsPhoneNotify" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.11" __config__ = [("push-id" , "str" , "Push ID" , "" ), ("push-url" , "str" , "Push url" , "" ), -- cgit v1.2.3 From f4b893e5ee24769584a2da1866c665489f7019ec Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 06:56:13 +0200 Subject: Hook plugin code cosmetics --- module/plugins/hooks/WindowsPhoneNotify.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/WindowsPhoneNotify.py') diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index dfc93f89c..97e3b6da4 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -61,7 +61,7 @@ class WindowsPhoneNotify(Hook): self.notify(_("Exiting pyLoad")) - def newCaptchaTask(self, task): + def captcha_task(self, task): if not self.getConfig('notifycaptcha'): return @@ -104,13 +104,13 @@ class WindowsPhoneNotify(Hook): elapsed_time = time.time() - self.last_notify - if elapsed_time < self.getConf("sendtimewait"): + if elapsed_time < self.getConfig("sendtimewait"): return if elapsed_time > 60: self.notifications = 0 - elif self.notifications >= self.getConf("sendpermin"): + elif self.notifications >= self.getConfig("sendpermin"): return request = self.getXmlData("%s: %s" % (event, msg) if msg else event) -- 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/WindowsPhoneNotify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/WindowsPhoneNotify.py') diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 97e3b6da4..86a5f2308 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -47,11 +47,11 @@ class WindowsPhoneNotify(Hook): self.notify(_("Plugins updated"), str(type_plugins)) - def coreReady(self): + def activate(self): self.key = (self.getConfig('push-id'), self.getConfig('push-url')) - def coreExiting(self): + def exit(self): if not self.getConfig('notifyexit'): 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/WindowsPhoneNotify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/WindowsPhoneNotify.py') diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 86a5f2308..713499322 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -68,7 +68,7 @@ class WindowsPhoneNotify(Hook): self.notify(_("Captcha"), _("New request waiting user input")) - def packageFinished(self, pypack): + def package_finished(self, pypack): if self.getConfig('notifypackage'): self.notify(_("Package finished"), pypack.name) -- 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/WindowsPhoneNotify.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'module/plugins/hooks/WindowsPhoneNotify.py') diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 713499322..511b4b568 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -9,7 +9,7 @@ from module.plugins.internal.Hook import Hook, Expose class WindowsPhoneNotify(Hook): __name__ = "WindowsPhoneNotify" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("push-id" , "str" , "Push ID" , "" ), ("push-url" , "str" , "Push url" , "" ), @@ -34,25 +34,26 @@ class WindowsPhoneNotify(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - self.event_list = ["allDownloadsProcessed", "plugin_updated"] + self.event_list = ["plugin_updated"] + self.event_map = {'allDownloadsProcessed': "all_downloads_processed"} self.last_notify = 0 self.notifications = 0 def plugin_updated(self, type_plugins): - if not self.getConfig('notifyupdate'): + if not self.get_config('notifyupdate'): return self.notify(_("Plugins updated"), str(type_plugins)) def activate(self): - self.key = (self.getConfig('push-id'), self.getConfig('push-url')) + self.key = (self.get_config('push-id'), self.get_config('push-url')) def exit(self): - if not self.getConfig('notifyexit'): + if not self.get_config('notifyexit'): return if self.core.do_restart: @@ -62,19 +63,19 @@ class WindowsPhoneNotify(Hook): def captcha_task(self, task): - if not self.getConfig('notifycaptcha'): + if not self.get_config('notifycaptcha'): return self.notify(_("Captcha"), _("New request waiting user input")) def package_finished(self, pypack): - if self.getConfig('notifypackage'): + if self.get_config('notifypackage'): self.notify(_("Package finished"), pypack.name) - def allDownloadsProcessed(self): - if not self.getConfig('notifyprocessed'): + def all_downloads_processed(self): + if not self.get_config('notifyprocessed'): return if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): @@ -83,7 +84,7 @@ class WindowsPhoneNotify(Hook): self.notify(_("All packages finished")) - def getXmlData(self, msg): + def get_xml_data(self, msg): return (" " " pyLoad %s " " " % msg) @@ -99,21 +100,21 @@ class WindowsPhoneNotify(Hook): if not id or not url: return - if self.core.isClientConnected() and not self.getConfig('ignoreclient'): + if self.core.isClientConnected() and not self.get_config('ignoreclient'): return elapsed_time = time.time() - self.last_notify - if elapsed_time < self.getConfig("sendtimewait"): + if elapsed_time < self.get_config("sendtimewait"): return if elapsed_time > 60: self.notifications = 0 - elif self.notifications >= self.getConfig("sendpermin"): + elif self.notifications >= self.get_config("sendpermin"): return - request = self.getXmlData("%s: %s" % (event, msg) if msg else event) + request = self.get_xml_data("%s: %s" % (event, msg) if msg else event) webservice = httplib.HTTP(url) webservice.putrequest("POST", id) -- 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/WindowsPhoneNotify.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'module/plugins/hooks/WindowsPhoneNotify.py') diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 511b4b568..b4b4d2658 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -3,10 +3,10 @@ import httplib import time -from module.plugins.internal.Hook import Hook, Expose +from module.plugins.internal.Addon import Addon, Expose -class WindowsPhoneNotify(Hook): +class WindowsPhoneNotify(Addon): __name__ = "WindowsPhoneNotify" __type__ = "hook" __version__ = "0.12" @@ -28,12 +28,7 @@ class WindowsPhoneNotify(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 init(self): self.event_list = ["plugin_updated"] self.event_map = {'allDownloadsProcessed': "all_downloads_processed"} -- 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/WindowsPhoneNotify.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/WindowsPhoneNotify.py') diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index b4b4d2658..ebd755c90 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -51,7 +51,7 @@ class WindowsPhoneNotify(Addon): if not self.get_config('notifyexit'): return - if self.core.do_restart: + if self.pyload.do_restart: self.notify(_("Restarting pyLoad")) else: self.notify(_("Exiting pyLoad")) @@ -73,7 +73,7 @@ class WindowsPhoneNotify(Addon): if not self.get_config('notifyprocessed'): return - if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): + if any(True for pdata in self.pyload.api.getQueue() if pdata.linksdone < pdata.linkstotal): self.notify(_("Package failed"), _("One or more packages was not completed successfully")) else: self.notify(_("All packages finished")) @@ -95,7 +95,7 @@ class WindowsPhoneNotify(Addon): if not id or not url: return - if self.core.isClientConnected() and not self.get_config('ignoreclient'): + if self.pyload.isClientConnected() and not self.get_config('ignoreclient'): return elapsed_time = time.time() - self.last_notify -- 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/WindowsPhoneNotify.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hooks/WindowsPhoneNotify.py') diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index ebd755c90..a554642e3 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -10,6 +10,7 @@ class WindowsPhoneNotify(Addon): __name__ = "WindowsPhoneNotify" __type__ = "hook" __version__ = "0.12" + __status__ = "stable" __config__ = [("push-id" , "str" , "Push ID" , "" ), ("push-url" , "str" , "Push url" , "" ), -- 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/WindowsPhoneNotify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/WindowsPhoneNotify.py') diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index a554642e3..900d94a04 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -10,7 +10,7 @@ class WindowsPhoneNotify(Addon): __name__ = "WindowsPhoneNotify" __type__ = "hook" __version__ = "0.12" - __status__ = "stable" + __status__ = "testing" __config__ = [("push-id" , "str" , "Push ID" , "" ), ("push-url" , "str" , "Push url" , "" ), -- cgit v1.2.3