summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/AndroidPhoneNotify.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-10 01:55:52 +0100
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-10 01:55:52 +0100
commit7beb65e991bc6d1913c3b5bb2ef69e659d5b8342 (patch)
treee076082f6cb799a820eee287c47f24f082b3a41c /module/plugins/hooks/AndroidPhoneNotify.py
parent[DDLMusicOrg] Removed (diff)
downloadpyload-7beb65e991bc6d1913c3b5bb2ef69e659d5b8342.tar.xz
Spare code cosmetics
Diffstat (limited to 'module/plugins/hooks/AndroidPhoneNotify.py')
-rw-r--r--module/plugins/hooks/AndroidPhoneNotify.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py
index 7a9e6d6f8..180ad0d78 100644
--- a/module/plugins/hooks/AndroidPhoneNotify.py
+++ b/module/plugins/hooks/AndroidPhoneNotify.py
@@ -40,19 +40,19 @@ class AndroidPhoneNotify(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):
@@ -62,13 +62,15 @@ class AndroidPhoneNotify(Hook):
@Expose
- def notify(self, event, msg=""):
- apikey = self.getConfig("apikey")
+ def notify(self,
+ event,
+ msg="",
+ key=self.getConfig('apikey')):
- if not apikey:
+ if not key:
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
@@ -84,7 +86,7 @@ class AndroidPhoneNotify(Hook):
getURL("http://www.notifymyandroid.com/publicapi/notify",
- get={'apikey' : apikey,
+ get={'apikey' : key,
'application': "pyLoad",
'event' : event,
'description': msg})