Repository navigation
Expand file tree
/
Copy pathAndroidPhoneNotify.py
More file actions
40 lines (33 loc) · 1.78 KB
/
Copy pathAndroidPhoneNotify.py
File metadata and controls
40 lines (33 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
from ..internal.Notifier import Notifier
class AndroidPhoneNotify(Notifier):
__name__ = "AndroidPhoneNotify"
__type__ = "hook"
__version__ = "0.16"
__status__ = "testing"
__config__ = [("activated", "bool", "Activated", False),
("apikey", "str", "API key", ""),
("captcha", "bool", "Notify captcha request", True),
("reconnection", "bool", "Notify reconnection request", False),
("downloadfinished", "bool", "Notify download finished", True),
("downloadfailed", "bool", "Notify download failed", True),
("packagefinished", "bool", "Notify package finished", True),
("packagefailed", "bool", "Notify package failed", True),
("update", "bool", "Notify pyLoad update", False),
("exit", "bool", "Notify pyLoad shutdown/restart", False),
("sendinterval", "int",
"Interval in seconds between notifications", 1),
("sendpermin", "int", "Max notifications per minute", 60),
("ignoreclient", "bool", "Send notifications if client is connected", True)]
__description__ = """Send push notifications to your Android Phone using notifymyandroid.com"""
__license__ = "GPLv3"
__authors__ = [("Steven Kosyra", "steven.kosyra@gmail.com"),
("Walter Purcaro", "vuolter@gmail.com")]
def get_key(self):
return self.config.get('apikey')
def send(self, event, msg, key):
self.load("http://www.notifymyandroid.com/publicapi/notify",
get={'apikey': key,
'application': "pyLoad",
'event': event,
'description': msg})