Index: wflow-py/wflow/wflow_sbm.py =================================================================== diff -u -r4143969ebd6b276284ea6e4198ee693bd6ab506a -rb6ba3d8e50ff32ef284800a790979b651cd83b69 --- wflow-py/wflow/wflow_sbm.py (.../wflow_sbm.py) (revision 4143969ebd6b276284ea6e4198ee693bd6ab506a) +++ wflow-py/wflow/wflow_sbm.py (.../wflow_sbm.py) (revision b6ba3d8e50ff32ef284800a790979b651cd83b69) @@ -96,7 +96,7 @@ from wflow.wf_DynamicFramework import * from wflow.wflow_funcs import * from wflow.wflow_adapt import * -import configparser +import ConfigParser wflow = "wflow_sbm: " @@ -107,8 +107,9 @@ def usage(*args): sys.stdout = sys.stderr """Way""" - for msg in args: print(msg) - print(__doc__) + for msg in args: + print msg + print __doc__ sys.exit(0) @@ -3067,26 +3068,34 @@ ## Process command-line options # ######################################################################## try: - opts, args = getopt.getopt(argv, 'XL:hC:Ii:v:S:T:WR:u:s:EP:p:Xx:U:fOc:l:') - except getopt.error as msg: + opts, args = getopt.getopt(argv, "XL:hC:Ii:v:S:T:WR:u:s:EP:p:Xx:U:fOc:l:") + except getopt.error, msg: pcrut.usage(msg) for o, a in opts: - if o == '-C': caseName = a - if o == '-R': runId = a - if o == '-c': configfile = a - if o == '-L': LogFileName = a - if o == '-s': timestepsecs = int(a) - if o == '-h': usage() - if o == '-f': _NoOverWrite = 0 - if o == '-l': exec("loglevel = logging." + a) + if o == "-C": + caseName = a + if o == "-R": + runId = a + if o == "-c": + configfile = a + if o == "-L": + LogFileName = a + if o == "-s": + timestepsecs = int(a) + if o == "-h": + usage() + if o == "-f": + _NoOverWrite = 0 + if o == "-l": + exec "loglevel = logging." + a + starttime = dt.datetime(1990, 01, 01) - starttime = dt.datetime(1990,0o1,0o1) - if _lastTimeStep < _firstTimeStep: - print("The starttimestep (" + str(_firstTimeStep) + ") is smaller than the last timestep (" + str( - _lastTimeStep) + ")") + print "The starttimestep (" + str( + _firstTimeStep + ) + ") is smaller than the last timestep (" + str(_lastTimeStep) + ")" usage() myModel = WflowModel(wflow_cloneMap, caseName, runId, configfile) @@ -3135,7 +3144,7 @@ configset(myModel.config, "model", "updating", "1", overwrite=True) if o == "-u": zz = [] - exec("zz =" + a) + exec "zz =" + a updateCols = zz if o == "-E": configset(myModel.config, "model", "reInfilt", "1", overwrite=True)