Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > b8d45c73759b3e63494f293ada0b3268 > files > 15

gamin-python-0.1.7-10.el5.x86_64.rpm

#!/usr/bin/env python

import gamin
import time

def callback(path, event):
    #print "Got callback: %s, %s" % (path, event)
    pass

mon = gamin.WatchMonitor()
mon.watch_directory(".", callback)
mon.handle_one_event()
time.sleep(1)
mon.handle_events()
mon.stop_watch(".")
mon.disconnect()
del mon

print "OK"