README.rst
1GNTP
2====
3
4This is a Python library for working with the `Growl Notification
5Transport Protocol <http://www.growlforwindows.com/gfw/help/gntp.aspx>`_
6
7It should work as a dropin replacement for the older Python bindings
8
9Installation
10------------
11
12You can install with pip
13
14::
15
16 $ pip install gntp
17
18then test the module
19
20::
21
22 $ python -m gntp.notifier
23
24Simple Usage
25------------
26
27::
28
29 # GNTP uses the standard Python logging
30 import logging
31 logging.basicConfig(level=logging.INFO)
32
33 import gntp.notifier
34
35 # Simple "fire and forget" notification
36 gntp.notifier.mini("Here's a quick message")
37
38 # More complete example
39 growl = gntp.notifier.GrowlNotifier(
40 applicationName = "My Application Name",
41 notifications = ["New Updates","New Messages"],
42 defaultNotifications = ["New Messages"],
43 # hostname = "computer.example.com", # Defaults to localhost
44 # password = "abc123" # Defaults to a blank password
45 )
46 growl.register()
47
48 # Send one message
49 growl.notify(
50 noteType = "New Messages",
51 title = "You have a new message",
52 description = "A longer message description",
53 icon = "http://example.com/icon.png",
54 sticky = False,
55 priority = 1,
56 )
57
58 # Try to send a different type of message
59 # This one may fail since it is not in our list
60 # of defaultNotifications
61 growl.notify(
62 noteType = "New Updates",
63 title = "There is a new update to download",
64 description = "A longer message description",
65 icon = "http://example.com/icon.png",
66 sticky = False,
67 priority = -1,
68 )
69
70
71URL based images do not work in the OSX version of
72`growl <http://code.google.com/p/growl/issues/detail?id=423>`_ 1.4
73You can send the image along with the notification to get around this.
74
75::
76
77 image = open('/path/to/image.png', 'rb').read()
78 growl.notify(
79 noteType = "New Messages",
80 title = "You have a new message",
81 description = "This time we embed the image",
82 icon = image,
83 )
84
85.. note:: With Growl 2 and above user can choose to pass notification to system
86 wide notifications center. In this case ``icon`` argument would be ignored
87 by the notification center (there would always be Growl icon instead).
88
89Bugs
90----
91
92`GitHub issue tracker <https://github.com/kfdm/gntp/issues>`_
93
94
95Changelog
96---------
97`v1.0.3 <https://github.com/kfdm/gntp/compare/v1.0.2...v1.0.3>`_
98 - Allow file:// scheme to be used for icons
99
100`v1.0.2 <https://github.com/kfdm/gntp/compare/v1.0.1...v1.0.2>`_
101 - Fix bug with incoming password hash
102 - Added info about license in each source file
103
104`v1.0.1 <https://github.com/kfdm/gntp/compare/v1.0...v1.0.1>`_
105 - Fix bug with binary data (images) being encoded incorrectly
106
107`v1.0 <https://github.com/kfdm/gntp/compare/v0.9...v1.0>`_
108 - Python 3.3 Support
109
110`v0.9 <https://github.com/kfdm/gntp/compare/v0.8...v0.9>`_
111 - Remove duplicate code from gntp.config
112 - Catch all errors and rethrow them as gntp.errors to make it easier for
113 other programs to deal with errors from the gntp library.
114 - Ensure that we open resource files as "rb" and update the documentation
115
116`v0.8 <https://github.com/kfdm/gntp/compare/v0.7...v0.8>`_
117 - Fix a bug where resource sections were missing a CRLF
118 - Fix a bug where the cli client was using config values over options
119 - Add support for coalescing
120
121`v0.7 <https://github.com/kfdm/gntp/compare/0.6...v0.7>`_
122 - Support for images
123 - Better test coverage support
124
125`0.6 <https://github.com/kfdm/gntp/compare/0.5...0.6>`_
126 - ConfigParser aware GrowlNotifier that reads settings from ~/.gntp
127