1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import logging
22
23 from _version import __version__
24 import nma
25 import prowl
26 import pushover
27
28
29 logger = logging.getLogger(__package__)
30
31
32 -def get_client(type_, developerkey='', application=''):
33 """Get a pushnotify client of the specified type.
34
35 Args:
36 type_: A string containing the type of client to get. Valid
37 types are 'nma,' 'prowl,', and 'pushover,' for Notify My
38 Android, Prowl, and Pushover clients, respectively.
39 developerkey: A string containing a valid developer key for the
40 given type_ of client.
41 application: A string containing the name of the application on
42 behalf of whom the client will be sending messages.
43
44 Returns:
45 An nma.Client, prowl.Client, or pushover.Client.
46
47 """
48
49 type_ = type_.lower()
50
51 if type_ == 'nma':
52 return nma.Client(developerkey, application)
53 elif type_ == 'prowl':
54 return prowl.Client(developerkey, application)
55 elif type_ == 'pushover':
56 return pushover.Client(developerkey, application)
57
58
59 if __name__ == '__main__':
60 pass
61