From: <mk...@us...> - 2003-07-23 01:29:01
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Bin In directory sc8-pr-cvs1:/tmp/cvs-serv24189/Bin Modified Files: CSPSim.py Log Message: Index: CSPSim.py =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Bin/CSPSim.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CSPSim.py 22 Jul 2003 07:36:36 -0000 1.6 --- CSPSim.py 23 Jul 2003 01:28:58 -0000 1.7 *************** *** 67,72 **** print sys.exit(1) ! datapath = CSP.getDataPath() ! dar = os.path.join(datapath, "sim.dar") if not os.path.exists(dar): print --- 67,72 ---- print sys.exit(1) ! cachepath = CSP.getCachePath() ! dar = os.path.join(cachepath, "sim.dar") if not os.path.exists(dar): print *************** *** 93,98 **** def compileData(args): ! datapath = CSP.getDataPath() ! dar = os.path.join(datapath, "sim.dar") XML = os.path.join(datapath, "XML") CSP.csplog().setLogLevels(CSP.CSP_ALL, SimData.LOG_ALERT) --- 93,98 ---- def compileData(args): ! cachepath = CSP.getCachePath() ! dar = os.path.join(cachepath, "sim.dar") XML = os.path.join(datapath, "XML") CSP.csplog().setLogLevels(CSP.CSP_ALL, SimData.LOG_ALERT) *************** *** 124,132 **** action = None - config = "../Data/CSPSim.ini" - if os.path.exists("CSPSim.ini") or not os.path.exists(config): - config = "CSPSim.ini" # process command line options --- 124,141 ---- action = None + # do our best to find the correct configuration file + if os.name == "posix": + config_paths = [".", "~/.cspsim", "/etc/cspsim", "../Data"] + else: + config_paths = [".", "../Data"] + config = "CSPSim.ini" + for path in config_paths: + path = os.path.join(path, "CSPSim.ini") + path = os.path.expanduser(path) + if os.path.exists(path): + config = path + break # process command line options *************** *** 215,218 **** --- 224,228 ---- SimData.log().setLogLevels(SimData.LOG_ALL, SimData.LOG_ALERT) + print "Loading configuration from '%s'." % config if not CSP.openConfig(config): print "Unable to open primary configuration file (%s)" % config |