Permalink
Browse files

Update examples in README

Fix minor bugs in the examples and add some additional comments to
clarify usage.

Fixes #14
  • Loading branch information...
1 parent a43267f commit 76f6e1096ed76e52105b292c82ce2137c9ce6360 @kfdm committed Dec 23, 2011
Showing with 30 additions and 7 deletions.
  1. +30 −7 README.md
View
@@ -4,32 +4,55 @@ This is a Python library for working with the [Growl Notification Transport Prot
It should work as a dropin replacement for the older Python bindings
+
+## Installation
+You can install with pip
+
+ $ pip install gntp
+
+then test the module
+
+ $ python -m gntp.notifier
+
## Simple Usage
```python
import gntp.notifier
+
+# Simple "fire and forget" notification
+gntp.notifier.mini("Here's a quick message")
+
+# More complete example
growl = gntp.notifier.GrowlNotifier(
applicationName = "My Application Name",
- notifications = ["New Updates","New Message"],
+ notifications = ["New Updates","New Messages"],
defaultNotifications = ["New Messages"],
- hostname = "computer.example.com",
- password = "abc123"
+ # hostname = "computer.example.com", # Defaults to localhost
+ # password = "abc123" # Defaults to a blank password
)
growl.register()
+# Send one message
growl.notify(
- noteType = "New Message",
+ noteType = "New Messages",
title = "You have a new message",
description = "A longer message description",
icon = "http://example.com/icon.png",
sticky = False,
priority = 1,
)
-```
-## Installation
+# Send a different message
+growl.notify(
+ noteType = "New Updates",
+ title = "There is a new update to download",
+ description = "A longer message description",
+ icon = "http://example.com/icon.png",
+ sticky = False,
+ priority = -1,
+)
- $ pip install gntp
+```
## Bugs

0 comments on commit 76f6e10

Please sign in to comment.