Class to read the trivial ASCII file containing the candles
Definition at line 162 of file cmsRelvalreport.py.
def cmsRelvalreport.Candles_file.__init__ |
( |
|
self, |
|
|
|
filename |
|
) |
| |
Definition at line 166 of file cmsRelvalreport.py.
171 candlesfile=open(filename,
'r')
173 if filename[-3:]==
'xml':
180 from xml.dom
import minidom
183 xmldoc = minidom.parse(filename)
186 candles_list = xmldoc.getElementsByTagName(
'candle')
191 for candle
in candles_list:
193 for child
in candle.childNodes:
194 if 'nodeName' not in child.__dict__:
198 tag_name=child.tagName
200 data=child.firstChild.data
203 info_dict[tag_name]=data
205 candles_dict_list.append(info_dict)
209 for candle_dict
in candles_dict_list:
211 command=candle_dict[
'command']
212 profiler=candle_dict[
'profiler']
213 meta=candle_dict[
'meta']
216 db_meta=candle_dict[
'db_meta']
220 reuse=candle_dict[
'reuse']
224 self.commands_profilers_meta_list.append([command,profiler,meta,reuse,db_meta])
228 for candle
in candlesfile.readlines():
230 if candle[0]!=
'#' and candle.strip(
' \n\t')!=
'':
233 splitted_candle=candle.split(
'@@@')
236 command=splitted_candle[0]
237 profiler=splitted_candle[1].strip(
' \t')
238 meta=splitted_candle[2].strip(
' \t')
239 info=[command,profiler,meta]
243 len_splitted_candle=len(splitted_candle)
245 if len_splitted_candle>3:
247 if 'reuse' in splitted_candle[3]:
254 if len_splitted_candle>4
or (len_splitted_candle>3
and not reuse):
255 cmssw_scram_version_string=splitted_candle[-1].strip(
' \t')
256 info.append(cmssw_scram_version_string)
261 self.commands_profilers_meta_list.append(info)
commands_profilers_meta_list