1 """copyright: Copyright (c) Jeffrey Goettsch and other contributors.
2 license: BSD, see LICENSE for details.
3
4 """
5
6 import logging
7
8 import nma
9 import prowl
10 import pushover
11
12
13 logger = logging.getLogger(__package__)
14
15
16 -def get_client(type_, developerkey='', application=''):
17 """Get a pushnotify client of the specified type.
18
19 Args:
20 type_: A string containing the type of client to get. Valid
21 types are 'nma,' 'prowl,', and 'pushover,' for Notify My
22 Android, Prowl, and Pushover clients, respectively.
23 developerkey: A string containing a valid developer key for the
24 given type_ of client.
25 application: A string containing the name of the application on
26 behalf of whom the client will be sending messages.
27
28 Returns:
29 An nma.Client, prowl.Client, or pushover.Client.
30
31 """
32
33 type_ = type_.lower()
34
35 if type_ == 'nma':
36 return nma.Client(developerkey, application)
37 elif type_ == 'prowl':
38 return prowl.Client(developerkey, application)
39 elif type_ == 'pushover':
40 return pushover.Client(developerkey, application)
41
42
43 if __name__ == '__main__':
44 pass
45