» Main »
simple_notify - A simple python-inotify wrapper
Published by Tim Cuthbertson
- Overview
This is a Zero Install feed. To add this program to your Applications menu, choose Zero Install -> Add New Program from the Applications menu. e.g. on Ubuntu:
If you don't see this menu item, install the zeroinstall-injector package from your distribution's repository, or from 0install.net.
Drag the feed's URL to the dialog box that appears. Other environments may use other systems. For example, if you are a ROX desktop user, drag the link to AddApp instead.
Alternatively, to run it from the command-line:
$ 0launch http://gfxmonk.net/dist/0install/simple_notify.xml
The 0alias command can be used to create a short-cut to run it again later.
If you don't have the 0launch command, download it from the 0install.net web-site, which also contains documentation about how the Zero Install system works.
- Full name
- Homepage
- Description
**Note**: I have discontinued development of simple_notify, in favour of using the cross-platform `watchdog` library: https://github.com/gorakhargosh/watchdog Example: import simple_notify def on_change(event): print "event " + event.event + " occurred to " + event.path watcher = simple_notify.watch("/tmp", callback=on_change) raw_input("press enter to quit...") ----- watch() spawns a new thread that will watch for inotify events and call your callback function. Directories are tracked recursively, so when watching "/tmp" you would see everything that happens in /tmp and any of its subdirectories Your callback receives as its single argument an Event instance. Event instances have the following fields: - path: path to file (relative to the watched root) - base: relative path to directory containing this node (from watch root) - name: name of this node - exists: (boolean) whether the file in this event now exists. False for REMOVED and MOVED_FROM events, True for ADDED, MODIFIED and MOVED_TO events - is_dir: boolean You can pass `ignore_modifications=True` to `watch` if you don't wish to be nodified of file modification events (merely additions, removals and moves).
- Available versions
The list below is just for information; Zero Install will automatically select one of these versions for you.
Version Released Stability Platform Download 0.1 2010-12-04 Any Download (1247 bytes) 0.1.1 2010-12-05 Any Download (1184 bytes) 0.2 2011-01-11 Any Download (2155 bytes) - Required libraries
The list below is just for information; Zero Install will automatically download any required libraries for you.