norm file format spec lines beginning with a semicolon ';' a pound sign '#' or the letters 'REM' (uppercase or lowercase) will be ignored. More...
Public Member Functions | |
def | __init__ |
def | parse |
Private Attributes | |
__datasectionname | |
__defsectionname | |
__inifilename | |
__parser |
norm file format spec lines beginning with a semicolon ';' a pound sign '#' or the letters 'REM' (uppercase or lowercase) will be ignored.
section uppercase [NORMDEFINITION] #section required only if first create name=HFtest #priority to commandline --name option if present comment= lumitype= istypedefault= [NORMDATA Since] # section required since= corrector= norm_occ1= norm_occ2= amodetag= egev= comment= ...
Definition at line 23 of file normFileParser.py.
def normFileParser::normFileParser::__init__ | ( | self, | |
filename | |||
) |
Definition at line 24 of file normFileParser.py.
void GenParticlePruner::parse | ( | self | ) |
output: [ {defoption:value},[{dataoption:value}] ]
Definition at line 29 of file normFileParser.py.
00030 : 00031 ''' 00032 output: 00033 [ {defoption:value},[{dataoption:value}] ] 00034 ''' 00035 if not os.path.exists(self.__inifilename) or not os.path.isfile(self.__inifilename): 00036 raise ValueError(self.__inifilename+' is not a file or does not exist') 00037 self.__parser.read(self.__inifilename) 00038 result=[] 00039 defsectionResult={} 00040 datasectionResult=[] 00041 sections=self.__parser.sections() 00042 for section in sections: 00043 thisectionresult={} 00044 options=self.__parser.options(section) 00045 for o in options: 00046 try: 00047 thisectionresult[o]=self.__parser.get(section,o) 00048 except: 00049 continue 00050 if section==self.__defsectionname: 00051 defsectionResult=thisectionresult 00052 elif self.__datasectionname in section: 00053 datasectionResult.append(thisectionresult) return [defsectionResult,datasectionResult]
Definition at line 24 of file normFileParser.py.
Definition at line 24 of file normFileParser.py.
Definition at line 24 of file normFileParser.py.
normFileParser::normFileParser::__parser [private] |
Definition at line 24 of file normFileParser.py.