diff options
author | Sebastien Martini <seb@dbzteam.org> | 2010-05-13 22:42:40 +0200 |
---|---|---|
committer | Sebastien Martini <seb@dbzteam.org> | 2010-05-13 22:42:40 +0200 |
commit | 2f2dd6ba0999dbc40e5bfbcc66af2cc676d3046a (patch) | |
tree | 75e2278e1c90e73c37e41a316ab609658abf1a7f | |
parent | b18898f9d88319c43a06ad1052c3daa82e9d3022 (diff) | |
download | pyinotify-2f2dd6ba0999dbc40e5bfbcc66af2cc676d3046a.tar.gz |
Updated examples.
-rw-r--r-- | python2/examples/tutorial_asyncnotifier.py | 4 | ||||
-rw-r--r-- | python2/examples/tutorial_notifier.py | 6 | ||||
-rw-r--r-- | python2/examples/tutorial_threadednotifier.py | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/python2/examples/tutorial_asyncnotifier.py b/python2/examples/tutorial_asyncnotifier.py index 16e276f..0e98a8b 100644 --- a/python2/examples/tutorial_asyncnotifier.py +++ b/python2/examples/tutorial_asyncnotifier.py @@ -8,14 +8,14 @@ import pyinotify wm = pyinotify.WatchManager() # Watch Manager mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE # watched events -class HandleEvents(pyinotify.ProcessEvent): +class EventHandler(pyinotify.ProcessEvent): def process_IN_CREATE(self, event): print "Creating:", event.pathname def process_IN_DELETE(self, event): print "Removing:", event.pathname -notifier = pyinotify.AsyncNotifier(wm, HandleEvents()) +notifier = pyinotify.AsyncNotifier(wm, EventHandler()) wdd = wm.add_watch('/tmp', mask, rec=True) asyncore.loop() diff --git a/python2/examples/tutorial_notifier.py b/python2/examples/tutorial_notifier.py index e807697..ad67473 100644 --- a/python2/examples/tutorial_notifier.py +++ b/python2/examples/tutorial_notifier.py @@ -7,15 +7,15 @@ import pyinotify wm = pyinotify.WatchManager() # Watch Manager mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE # watched events -class HandleEvents(pyinotify.ProcessEvent): +class EventHandler(pyinotify.ProcessEvent): def process_IN_CREATE(self, event): print "Creating:", event.pathname def process_IN_DELETE(self, event): print "Removing:", event.pathname -p = HandleEvents() -notifier = pyinotify.Notifier(wm, p) +handler = EventHandler() +notifier = pyinotify.Notifier(wm, handler) wdd = wm.add_watch('/tmp', mask, rec=True) notifier.loop() diff --git a/python2/examples/tutorial_threadednotifier.py b/python2/examples/tutorial_threadednotifier.py index 6fbb4cd..f1eb6c8 100644 --- a/python2/examples/tutorial_threadednotifier.py +++ b/python2/examples/tutorial_threadednotifier.py @@ -7,7 +7,7 @@ import pyinotify wm = pyinotify.WatchManager() # Watch Manager mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE # watched events -class HandleEvents(pyinotify.ProcessEvent): +class EventHandler(pyinotify.ProcessEvent): def process_IN_CREATE(self, event): print "Creating:", event.pathname @@ -16,7 +16,7 @@ class HandleEvents(pyinotify.ProcessEvent): #log.setLevel(10) -notifier = pyinotify.ThreadedNotifier(wm, HandleEvents()) +notifier = pyinotify.ThreadedNotifier(wm, EventHandler()) notifier.start() wdd = wm.add_watch('/tmp', mask, rec=True) |