Permalink
Browse files

Simple python script to watch a file and run rubber for making

pdfs from tex.
  • Loading branch information...
0 parents commit 07ce39d29845338d5274a8fd4ddf3f0e6758ec5f @igable committed Sep 28, 2010
Showing with 19 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +18 −0 texwatcher.py
@@ -0,0 +1 @@
+*~
@@ -0,0 +1,18 @@
+#!/opt/local/bin/python
+#import pickle
+import time
+import hashlib
+
+l = []
+db = dict(l)
+path = "/Users/igable/code/texwatcher/readme"
+while True:
+ checksum = hashlib.md5(open(path).read()).hexdigest()
+ if db.get(path, None) != checksum:
+ print checksum
+ print "\n"
+ print "file changed"
+ db[path] = checksum
+ time.sleep(2)
+
+#pickle.dump(db.items(), open("db", "w"))

0 comments on commit 07ce39d

Please sign in to comment.