0

initial version of the contribManager

This commit is contained in:
Andrew Chin
2011-08-16 20:52:43 -04:00
parent 8794f3a1d1
commit cd2a2bdf2c
2 changed files with 40 additions and 1 deletions

38
contribManager.py Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env python
# The contrib manager is used to help control the contribs script
# that are shipped with overviewer in Windows packages
import sys
import os.path
scripts=dict( # keys are names, values are scripts
benchmark="benchmark.py",
findSigns="findSigns.py",
validate="validateRegionFile.py"
)
# figure out what script to execute
argv=os.path.basename(sys.argv[0])
if argv[-4:] == ".exe":
argv=argv[0:-4]
if argv[-3:] == ".py":
argv=argv[0:-3]
print "argv is ", argv
if argv in scripts.keys():
script = scripts[argv]
else:
if sys.argv[1] in scripts.keys():
script = scripts[sys.argv[1]]
else:
print "what do you want to run?"
sys.exit(1)
print "running", script
execfile(os.path.join("contrib", script))