Permalink
Browse files

first commit, command still hardcoded in

  • Loading branch information...
0 parents commit 0fbef134cede8d1f7fe5bb7337803cc01702984f @leonardehrenfried committed Oct 9, 2010
Showing with 90 additions and 0 deletions.
  1. +45 −0 .gitignore
  2. +45 −0 runonsave.py
@@ -0,0 +1,45 @@
+syntax: glob
+
+# build directories and files
+**/build/*
+build/*
+target/**.* #hg syntax
+target #git syntax
+dist/**.*
+*.pyc
+
+
+#Eclipse
+.settings/*.**
+.classpath
+.project
+
+# Netbeans
+nb-configuration.xml
+nbactions.xml
+
+# Backup files left behind by the Emacs editor.
+*~
+# Lock files used by the Emacs editor.
+.\#*
+# Temporary files used by TestMate
+._*
+# XCode user data
+**.pbxuser
+**.mode?v?
+**.perspectivev?
+# documentation
+**.docset/*
+# for those crazies using svn and hg at the same time
+*.svn*
+*.swp
+
+# Random OS stuff
+.DS_Store
+Thumbs.db
+
+# temporary folders
+syntax: regexp
+.*/te?mp/.*
+# Temporary files used by the vim editor.
+.*.swp
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+"""
+SYNOPSIS
+
+ TODO helloworld [-h,--help] [-v,--verbose] [--version]
+
+DESCRIPTION
+
+ Runs a command when a file in the current working directory is changed
+
+EXAMPLES
+
+ TODO: Show some examples of how to use this script.
+
+EXIT STATUS
+
+ TODO: List exit codes
+
+AUTHOR
+
+ Leonard Ehrenfried <leonard.ehrenfried@web.de>
+
+"""
+
+import os
+import subprocess
+import time
+import re
+
+SCAN_INTERVAL=10
+
+def main ():
+ cwd = os.getcwd()
+ last_run=os.path.getmtime(cwd)
+ while(True):
+ last_modified=os.path.getmtime(cwd)
+ if (last_modified > last_run):
+ print "*** Save detected - running command ***"
+ subprocess.Popen(['pdflatex', 'cv.tex', ])
+ last_run=last_modified
+ time.sleep(SCAN_INTERVAL)
+
+if __name__ == '__main__':
+ main()
+

0 comments on commit 0fbef13

Please sign in to comment.