Skip to content

Commit

Permalink
first commit, command still hardcoded in
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Oct 9, 2010
0 parents commit 0fbef13
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .gitignore
@@ -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
45 changes: 45 additions & 0 deletions runonsave.py
@@ -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.