Changeset 4266
- Timestamp:
- 07/06/07 17:12:59 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
WaveDev/branches/WaveDevNoAmara/wavedev/MainFrame.py
r4265 r4266 31 31 import importNode 32 32 import NodeDialog 33 from amara import binderytools 33 import xml.dom.minidom 34 from xml.dom.minidom import Node 34 35 import generate.genNode as genNode 35 36 import webbrowser … … 2063 2064 ############################################################################### 2064 2065 def LoadConfiguration(frame_obj): 2065 doc_cfg = binderytools.bind_file('../wavedev.cfg') 2066 frame_obj.version = str(doc_cfg.owdconfiguration.version) 2066 '''Extracts information from configuration file''' 2067 2068 doc_cfg = xml.dom.minidom.parse('../wavedev.cfg') 2069 2070 # version 2071 try: 2072 frame_obj.version = \ 2073 str(doc_cfg.getElementsByTagName("version")[0].firstChild.data) 2074 except: 2075 frame_obj.version = "unknown" 2067 2076 2068 frame_obj.installPath = str(doc_cfg.owdconfiguration.installpath) 2069 if frame_obj.installPath[len(frame_obj.installPath)-1] != '/': 2070 frame_obj.installPath = frame_obj.installPath + '/' 2077 # install path 2078 try: 2079 frame_obj.installPath = \ 2080 str(doc_cfg.getElementsByTagName("installpath")[0].firstChild.data) 2081 if frame_obj.installPath[len(frame_obj.installPath)-1] != '/': 2082 frame_obj.installPath = frame_obj.installPath + '/' 2083 except: 2084 frame_obj.installPath = "" 2071 2085 2072 frame_obj.stdIdlPath = str(doc_cfg.owdconfiguration.stdidlpath) 2086 # standard IDL path 2087 try: 2088 frame_obj.stdIdlPath = str(doc_cfg.getElementsByTagName("stdidlpath")[0].firstChild.data) 2089 except: 2090 frame_obj.stdIdlPath = "" 2073 2091 if len(frame_obj.stdIdlPath) > 0: 2074 2092 if frame_obj.stdIdlPath[len(frame_obj.stdIdlPath)-1] != '/': … … 2086 2104 tmpstr += "in the wavedev.cfg file located in the top directory." 2087 2105 errorMsg(frame_obj,tmpstr) 2088 2089 frame_obj.ossieIncludePath = str(doc_cfg.owdconfiguration.ossieincludepath) 2106 2107 # ossie include path 2108 try: 2109 frame_obj.ossieIncludePath = \ 2110 str(doc_cfg.getElementsByTagName("ossieincludepath")[0].firstChild.data) 2111 except: 2112 frame_obj.ossieIncludePath = "" 2113 2090 2114 if len(frame_obj.ossieIncludePath) > 0: 2091 2115 if frame_obj.ossieIncludePath[len(frame_obj.ossieIncludePath)-1] != '/': … … 2104 2128 tmpstr += "wavedev.cfg file located in the top directory." 2105 2129 errorMsg(frame_obj,tmpstr) 2106 2107 if hasattr(doc_cfg.owdconfiguration,'homedir'):2108 frame_obj.homeDir = str(doc_cfg.owdconfiguration.homedir)2109 if len(frame_obj.homeDir) > 0:2110 if frame_obj.homeDir[len(frame_obj.homeDir)-1] != '/':2111 frame_obj.homeDir = frame_obj.homeDir + '/'2112 else: 2113 frame_obj.homeDir = ''2114 2115 2116 2117 2130 2131 # home directory 2132 try: 2133 frame_obj.homeDir = str(doc_cfg.getElementsByTagName("homedir")[0].firstChild.data) 2134 except: 2135 frame_obj.homeDir = "" 2136 2137 if len(frame_obj.homeDir) > 0: 2138 if frame_obj.homeDir[len(frame_obj.homeDir)-1] != '/': 2139 frame_obj.homeDir = frame_obj.homeDir + '/' 2140 2141