[open-ils-commits] r587 - constrictor/trunk (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jul 17 16:06:45 EDT 2009
Author: erickson
Date: 2009-07-17 16:06:41 -0400 (Fri, 17 Jul 2009)
New Revision: 587
Modified:
constrictor/trunk/constrictor.py
Log:
allow overriding of property filename
Modified: constrictor/trunk/constrictor.py
===================================================================
--- constrictor/trunk/constrictor.py 2009-07-17 20:02:07 UTC (rev 586)
+++ constrictor/trunk/constrictor.py 2009-07-17 20:06:41 UTC (rev 587)
@@ -23,6 +23,7 @@
from constrictor.utils import loadProps, saveProps, initDirs, initDB, openScript, PROPS_FILENAME
props = None
+props_filename = PROPS_FILENAME
droneController = None
def usage():
@@ -54,7 +55,7 @@
def readArgv():
# see if we have any command-line args that override the properties file
- ops, args = getopt.getopt(sys.argv[1:], 's:t:i:d:p:l:h')
+ ops, args = getopt.getopt(sys.argv[1:], 's:t:i:d:p:l:f:h')
options = dict( (k,v) for k,v in ops )
if options.has_key('-h'):
@@ -71,6 +72,8 @@
props.setProperty('constrictor.port', options['-p'])
if options.has_key('-l'):
props.setProperty('constrictor.listenAddress', options['-l'])
+ if options.has_key('-f'):
+ props_filename = options['-f']
@@ -79,7 +82,7 @@
summary = ScriptThread.currentScriptThread().dbConnection.createTaskSummary()
droneController.sendResult(type='task_summary', **summary)
-loadProps(PROPS_FILENAME)
+loadProps(props_filename)
props = Properties.getProperties()
readArgv()
initDirs()
More information about the open-ils-commits
mailing list