From: <sv...@ww...> - 2005-04-28 06:33:46
|
Author: mkrose Date: 2005-04-27 23:33:39 -0700 (Wed, 27 Apr 2005) New Revision: 1525 Modified: trunk/CSP/CSPSim/Bin/CSPSim.py trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Demo/Win/CSPSim.py Log: Fix potential problem with the .ini path test at startup. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1525 Modified: trunk/CSP/CSPSim/Bin/CSPSim.py =================================================================== --- trunk/CSP/CSPSim/Bin/CSPSim.py 2005-04-28 06:22:44 UTC (rev 1524) +++ trunk/CSP/CSPSim/Bin/CSPSim.py 2005-04-28 06:33:39 UTC (rev 1525) @@ -273,7 +273,11 @@ def findConfig(): # do our best to find the correct configuration file - config_paths = [".", "~/.cspsim", "/etc/cspsim", os.path.join(os.path.dirname(__file__), "../Data")] + config_paths = [".", "~/.cspsim", "/etc/cspsim"] + try: + config_paths.append(os.path.join(os.path.dirname(__file__), "../Data")) + except NameError: + pass config = "CSPSim.ini" for path in config_paths: Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-04-28 06:22:44 UTC (rev 1524) +++ trunk/CSP/CSPSim/CHANGES.current 2005-04-28 06:33:39 UTC (rev 1525) @@ -39,6 +39,8 @@ * Fix a small bug in the F16 yaw control circuit. Stops rudder jitter. + * Fix potential problem with the .ini path test at startup. + 2005-04-25: delta * Need to include a few headers to avoid a syntax error (g++ and vc++ don't manage forward class declaration equivalently). Modified: trunk/CSP/CSPSim/Demo/Win/CSPSim.py =================================================================== --- trunk/CSP/CSPSim/Demo/Win/CSPSim.py 2005-04-28 06:22:44 UTC (rev 1524) +++ trunk/CSP/CSPSim/Demo/Win/CSPSim.py 2005-04-28 06:33:39 UTC (rev 1525) @@ -272,15 +272,14 @@ def findConfig(): # do our best to find the correct configuration file - config_paths = [".", "~/.cspsim", "/etc/cspsim"] - try: - cwd = os.path.join(os.path.dirname(__file__)) - config_paths.append(cwd) - except NameError: - pass - - config_paths.append("../Data") + config_paths = [".", "~/.cspsim", "/etc/cspsim"] + try: + config_paths.append(os.path.join(os.path.dirname(__file__), "../Data")) + except NameError: + pass + config_paths.append("../Data") + config = "CSPSim.ini" for path in config_paths: path = os.path.join(path, "CSPSim.ini") |