diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-10 01:55:52 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-10 01:55:52 +0100 |
commit | 7beb65e991bc6d1913c3b5bb2ef69e659d5b8342 (patch) | |
tree | e076082f6cb799a820eee287c47f24f082b3a41c /module/plugins/hooks/WindowsPhoneNotify.py | |
parent | [DDLMusicOrg] Removed (diff) | |
download | pyload-7beb65e991bc6d1913c3b5bb2ef69e659d5b8342.tar.xz |
Spare code cosmetics
Diffstat (limited to 'module/plugins/hooks/WindowsPhoneNotify.py')
-rw-r--r-- | module/plugins/hooks/WindowsPhoneNotify.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 010198bf1..a1068ead5 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -41,19 +41,19 @@ class WindowsPhoneNotify(Hook): def newCaptchaTask(self, task): - if not self.getConfig("notifycaptcha"): + if not self.getConfig('notifycaptcha'): return self.notify(_("Captcha"), _("New request waiting user input")) def packageFinished(self, pypack): - if self.getConfig("notifypackage"): + if self.getConfig('notifypackage'): self.notify(_("Package finished"), pypack.name) def allDownloadsProcessed(self): - if not self.getConfig("notifyprocessed"): + if not self.getConfig('notifyprocessed'): return if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): @@ -69,14 +69,17 @@ class WindowsPhoneNotify(Hook): @Expose - def notify(self, event, msg=""): - id = self.getConfig("id") - url = self.getConfig("url") + def notify(self, + event, + msg="", + key=(self.getConfig('id'), self.getConfig('url'))): + + id, url = key if not id or not url: return - if self.core.isClientConnected() and not self.getConfig("ignoreclient"): + if self.core.isClientConnected() and not self.getConfig('ignoreclient'): return elapsed_time = time.time() - self.last_notify |