gntplib

Pure Python implementation of Growl Notification Transport Protocol client
Download

gntplib Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • papaeye
  • Publisher web site:
  • https://github.com/papaeye

gntplib Tags


gntplib Description

gntplib is a pure Python implementation of Growl Notification Transport Protocol client.Growl Notification Transport Protocol (GNTP) is specified: http://www.growlforwindows.com/gfw/help/gntp.aspxUsageSimple usage:>>> import gntplib>>> gntplib.notify('Simple', 'Simple Event', 'Simple Title', 'Simple Text')Basic usage:>>> notifier = gntplib.Notifier('Basic', )>>> notifier.register()>>> notifier.notify('Basic Event', 'Basic Title', 'Basic Text')gntplib.Event class has a bit more attributes:>>> events = >>> notifier = gntplib.Notifier('Event Sample 1', events)>>> notifier.register()And here is a convenient way:>>> notifier = gntplib.Notifier('Event Sample 2',... )>>> notifier.register()Then enabled event Event A and disabled event Event B are registered.You can use icon of < uniqueid > data type:>>> notifier = gntplib.Notifier('Icon', ,... icon=gntplib.Icon(open('app.png').read()))>>> notifier.register()>>> notifier.notify('Icon Event', 'Icon Title', 'Icon Title',... icon=gntplib.Icon(open('notification.png').read()))You can use socket callback:>>> import webbrowser>>> class BrowseCallback(gntplib.SocketCallback):... def if_clicked(self, response):... webbrowser.open_new_tab(self.context)>>> notifier = gntplib.Notifier('Callback', )>>> notifier.register()>>> notifier.notify('Callback Event', 'Click me!', 'Click me!',... callback=BrowseCallback('http://google.com'))Note- Because Application-Icon: < url > is not implemented in Growl 1.3.3, Passing string value as icon parameter of Notifier constructor does not work. Use Icon instance as above.- Because Notification-Icon at REGISTER request is not implemented in Growl 1.3.3, Event constructor's icon parameter does not work.- Because Notification-Icon: < url > at NOTIFY request is not implemented in Growl 1.3.3, Passing string value as icon parameter of Notify.nofity() method does not work. Use Icon instance as above.- Because Notification-Callback-Target is not implemented in Growl 1.3.3, Passing string value as callback parameter of Notify.notify() method does not work. Use SocketCallback instance as above.Product's homepage


gntplib Related Software