Public Member Functions | |
def | __init__ |
Definition at line 84 of file parseConfig.py.
def parseConfig::_IncludeFile::__init__ | ( | self, | ||
filename | ||||
) |
Searches for the 'filename' using the appropriate paths
Definition at line 85 of file parseConfig.py.
00085 : 00086 """Searches for the 'filename' using the appropriate paths""" 00087 import os.path 00088 from os import environ 00089 try: 00090 paths = environ['CMSSW_SEARCH_PATH'] 00091 except KeyError: 00092 raise RuntimeError("The environment variable 'CMSSW_SEARCH_PATH' must be set for include to work") 00093 lpaths = paths.split(':') 00094 lpaths.append('/afs/cern.ch/cms/sdt/misc/oldConfig/CMSSW') 00095 lpaths.append('.') 00096 f = None 00097 for path in lpaths: 00098 path +='/'+filename 00099 if os.path.exists(path): 00100 f=path 00101 break 00102 if f is None: 00103 raise RuntimeError("Unable to find file '"+filename+"' using the search path ${'CMSSW_SEARCH_PATH'} \n" 00104 +paths) 00105 super(_IncludeFile,self).__init__(path,'r') _fileFactory = _IncludeFile