[open-ils-commits] r588 - constrictor/trunk (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jul 17 16:10:43 EDT 2009
Author: erickson
Date: 2009-07-17 16:10:39 -0400 (Fri, 17 Jul 2009)
New Revision: 588
Modified:
constrictor/trunk/constrictor.py
Log:
allow overriding of property filename, part 2
Modified: constrictor/trunk/constrictor.py
===================================================================
--- constrictor/trunk/constrictor.py 2009-07-17 20:06:41 UTC (rev 587)
+++ constrictor/trunk/constrictor.py 2009-07-17 20:10:39 UTC (rev 588)
@@ -53,11 +53,19 @@
droneController.sendResult(type='task_summary', **summary)
-def readArgv():
+def read_args_and_props():
+ global props
+
# 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:f:h')
options = dict( (k,v) for k,v in ops )
+ if options.has_key('-f'):
+ props_filename = options['-f']
+
+ loadProps(props_filename)
+ props = Properties.getProperties()
+
if options.has_key('-h'):
usage()
if options.has_key('-s'):
@@ -72,8 +80,6 @@
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']
@@ -82,9 +88,7 @@
summary = ScriptThread.currentScriptThread().dbConnection.createTaskSummary()
droneController.sendResult(type='task_summary', **summary)
-loadProps(props_filename)
-props = Properties.getProperties()
-readArgv()
+read_args_and_props()
initDirs()
initLog()
scriptDirs = props.getProperty('constrictor.scriptDirs').split(',')
More information about the open-ils-commits
mailing list