Gaudi Framework, version v21r11

Home   Generated: 30 Sep 2010

GaudiTest::CMT Class Reference

List of all members.

Public Member Functions

def __init__
def __getattr__
def runtime_env
def show_macro

Public Attributes

 path

Private Member Functions

def _run_cmt


Detailed Description

Small wrapper to call CMT.

Definition at line 209 of file GaudiTest.py.


Member Function Documentation

def GaudiTest::CMT::__init__ (   self,
  path = None 
)

Definition at line 212 of file GaudiTest.py.

00212                                 :
00213         if path is None:
00214             path = os.getcwd()
00215         self.path = path
00216 
    def _run_cmt(self,command,args):

def GaudiTest::CMT::_run_cmt (   self,
  command,
  args 
) [private]

Definition at line 217 of file GaudiTest.py.

00217                                    :
00218         # prepare command line
00219         if type(args) is str:
00220             args = [args]
00221         cmd = "cmt %s"%command
00222         for arg in args:
00223             cmd += ' "%s"'%arg
00224 
00225         # go to the execution directory
00226         olddir = os.getcwd()
00227         os.chdir(self.path)
00228         # run cmt
00229         result = os.popen4(cmd)[1].read()
00230         # return to the old directory
00231         os.chdir(olddir)
00232         return result
00233 
    def __getattr__(self,attr):

def GaudiTest::CMT::__getattr__ (   self,
  attr 
)

Definition at line 234 of file GaudiTest.py.

00234                               :
00235         return lambda args=[]: self._run_cmt(attr, args)
00236 
    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 237 of file GaudiTest.py.

00237                                     :
00238         """Returns a dictionary containing the runtime environment produced by CMT.
00239         If a dictionary is passed a modified instance of it is returned.
00240         """
00241         if env is None:
00242             env = {}
00243         for l in self.setup("-csh").splitlines():
00244             l = l.strip()
00245             if l.startswith("setenv"):
00246                 dummy,name,value = l.split(None,3)
00247                 env[name] = value.strip('"')
00248             elif l.startswith("unsetenv"):
00249                 dummy,name = l.split(None,2)
00250                 if name in env:
00251                     del env[name]
00252         return env
    def show_macro(self,k):

def GaudiTest::CMT::show_macro (   self,
  k 
)

Definition at line 253 of file GaudiTest.py.

00253                           :
00254         r = self.show(["macro",k])
00255         if r.find("CMT> Error: symbol not found") >= 0:
00256             return None
00257         else:
00258             return self.show(["macro_value",k]).strip()
00259 
## Locates an executable in the executables path ($PATH) and returns the full


Member Data Documentation

Definition at line 215 of file GaudiTest.py.


The documentation for this class was generated from the following file:

Generated at Thu Sep 30 09:59:01 2010 for Gaudi Framework, version v21r11 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004