]> khamidou — GitHub mirrors - cagibi.git/commitdiff
added main file for client
authorkarim hamidou <khamidou@gmail.com>
Wed, 4 Jul 2012 07:46:27 +0000 (09:46 +0200)
committerkarim hamidou <khamidou@gmail.com>
Wed, 4 Jul 2012 07:46:27 +0000 (09:46 +0200)
cagibi/cagibi.py [new file with mode: 0644]

diff --git a/cagibi/cagibi.py b/cagibi/cagibi.py
new file mode 100644 (file)
index 0000000..54078d4
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+
+from watch import FileWatcher
+from rsync import *
+
+def changesHandler(modified, added, removed):
+    for file in modified:
+        fd = open(file, "rb")
+        hashes = blockchecksums(fd)
+        print hashes
+
+if __name__ == "__main__":
+    fw = FileWatcher()
+    fw.addHandler(changesHandler)
+    fw.watch()