Skip to content

Commit

Permalink
Updated examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-m committed May 13, 2010
1 parent b18898f commit 2f2dd6b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python2/examples/tutorial_asyncnotifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
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()
6 changes: 3 additions & 3 deletions python2/examples/tutorial_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
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()
4 changes: 2 additions & 2 deletions python2/examples/tutorial_threadednotifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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

Expand All @@ -16,7 +16,7 @@ def process_IN_DELETE(self, event):


#log.setLevel(10)
notifier = pyinotify.ThreadedNotifier(wm, HandleEvents())
notifier = pyinotify.ThreadedNotifier(wm, EventHandler())
notifier.start()

wdd = wm.add_watch('/tmp', mask, rec=True)
Expand Down

0 comments on commit 2f2dd6b

Please sign in to comment.