wail
wail copied to clipboard
Integrate with OS X notification center
The PyObjC package provides native bindings to many of the APIs and functionality including the notification center. WAIL does not currently utilize this module but might should, as it looks to have more potential for the OS X version of WAIL.
https://github.com/dschep/ntfy module may be helpful as a cross-platform solution to accomplishing this. A particular use case lies in alerting the user when a crawl has finished.
On second thought, ntfy does not look to have an API to allow it to be imported and used from other code.
@machawk1 you definitly can use ntfy as a python API, it's just not the primary use case so I haven't really documented it.
you can use:
import ntfy
ntfy.notify('a message', 'title')
but this will use the user's ntfy config so might not work as you want.
To ignore the user's config and use their platform's desktop notifications you can do:
from ntfy.backends.default import notify
notify('a message', 'title')
@dschep Thank you for this information. I'll test it out and see if it works for our use case.
Circling back, in using @dschep's sample above as tied to a button click event, I am unable to see a notification displayed. Using the snippet in a stand-alone script works as expected. I'm wondering if there's a conflict with, say, wxPython (e.g., https://wxpython.org/Phoenix/docs/html/wx.adv.NotificationMessage.html That's used for ALERTs) and ntfy.