11
expect = [gamin.GAMExists, gamin.GAMExists, gamin.GAMEndExist,
14
def callback(path, event):
15
global top, expect, ok
16
print "Got callback: %s, %s" % (path, event)
17
if expect[top] != event:
18
print "Error got event %d expected %d" % (event, expect[top])
22
shutil.rmtree ("temp_dir", True)
24
open("temp_dir/a", "w").close()
26
mon = gamin.WatchMonitor()
27
mon.watch_directory("temp_dir", callback)
29
fd = open("temp_dir/a", "w")
34
mon.stop_watch("temp_dir")
37
shutil.rmtree ("temp_dir", True)
39
print "Error: top monitor got %d events insteads of 4" % (top)