|
Gaudi Framework, version v21r7p1 |
| Home | Generated: 15 Feb 2010 |
Public Member Functions | |
| def | __init__ |
| def | __getattr__ |
| def | runtime_env |
| def | show_macro |
Public Attributes | |
| path | |
Private Member Functions | |
| def | _run_cmt |
Small wrapper to call CMT.
Definition at line 210 of file GaudiTest.py.
| def GaudiTest::CMT::__init__ | ( | self, | ||
path = None | ||||
| ) |
| def GaudiTest::CMT::_run_cmt | ( | self, | ||
| command, | ||||
| args | ||||
| ) | [private] |
Definition at line 218 of file GaudiTest.py.
00218 : 00219 # prepare command line 00220 if type(args) is str: 00221 args = [args] 00222 cmd = "cmt %s"%command 00223 for arg in args: 00224 cmd += ' "%s"'%arg 00225 00226 # go to the execution directory 00227 olddir = os.getcwd() 00228 os.chdir(self.path) 00229 # run cmt 00230 result = os.popen4(cmd)[1].read() 00231 # return to the old directory 00232 os.chdir(olddir) 00233 return result 00234 def __getattr__(self,attr):
| def GaudiTest::CMT::__getattr__ | ( | self, | ||
| attr | ||||
| ) |
Definition at line 235 of file GaudiTest.py.
00235 : 00236 return lambda args=[]: self._run_cmt(attr, args) 00237 def runtime_env(self,env = None):
| def GaudiTest::CMT::runtime_env | ( | self, | ||
env = None | ||||
| ) |
Returns a dictionary containing the runtime environment produced by CMT. If a dictionary is passed a modified instance of it is returned.
Definition at line 238 of file GaudiTest.py.
00238 : 00239 """Returns a dictionary containing the runtime environment produced by CMT. 00240 If a dictionary is passed a modified instance of it is returned. 00241 """ 00242 if env is None: 00243 env = {} 00244 for l in self.setup("-csh").splitlines(): 00245 l = l.strip() 00246 if l.startswith("setenv"): 00247 dummy,name,value = l.split(None,3) 00248 env[name] = value.strip('"') 00249 elif l.startswith("unsetenv"): 00250 dummy,name = l.split(None,2) 00251 if name in env: 00252 del env[name] 00253 return env def show_macro(self,k):
| def GaudiTest::CMT::show_macro | ( | self, | ||
| k | ||||
| ) |
Definition at line 254 of file GaudiTest.py.
00254 : 00255 r = self.show(["macro",k]) 00256 if r.find("CMT> Error: symbol not found") >= 0: 00257 return None 00258 else: 00259 return self.show(["macro_value",k]).strip() 00260 ## Locates an executable in the executables path ($PATH) and returns the full
Definition at line 216 of file GaudiTest.py.