Definition at line 4 of file readProv.py.
◆ __init__()
def python.readProv.filereader.__init__ |
( |
|
self | ) |
|
Definition at line 11 of file readProv.py.
12 self.aList=[
'Module',
'ESSource']
◆ readfile()
def python.readProv.filereader.readfile |
( |
|
self, |
|
|
|
nomefile |
|
) |
| |
Definition at line 21 of file readProv.py.
21 def readfile(self,nomefile):
22 "Reads the file line by line and searches for the begin and the end of each Module block"
23 aFile = open(nomefile)
29 insideModuleBlock =
False
30 insideParameterBlock =
False
33 for line
in aFile.readlines():
34 if line.startswith(
"Processing History:"):
37 elif (
not line.startswith(
'---------Event'))
and processHistory:
38 splitLine= line.split()
39 if splitLine[3]==
'[2]':
44 elif line.startswith(
'---------Event')
and processing:
45 file_modules[
'Processing']=value
48 elif self.startswith(line):
49 if insideParameterBlock:
50 module.append(tuple(value))
51 file_modules[key].
append(module)
52 insideParameterBlock =
False
53 insideModuleBlock =
False
56 splitLine= line.split()
58 if key
not in file_modules.keys():
60 module.append(splitLine[-2])
61 value.append(line[:-1])
62 insideModuleBlock =
True
63 insideParameterBlock =
False
64 elif (line.startswith(
' parameters'))
and insideModuleBlock:
65 insideParameterBlock =
True
66 value.append(line[:-1])
67 elif line.startswith(
'ESModule')
and insideParameterBlock:
68 module.append(tuple(value))
69 file_modules[key].
append(module)
70 insideParameterBlock =
False
71 insideModuleBlock =
False
77 elif (insideParameterBlock):
78 value.append(line[:-1])
80 if insideParameterBlock:
81 module.append(tuple(value))
82 file_modules[key].
append(module)
83 insideParameterBlock =
False
84 insideModuleBlock =
False
References mps_setup.append, python.read_provenance.filereader.startswith(), and python.readProv.filereader.startswith().
◆ startswith()
def python.readProv.filereader.startswith |
( |
|
self, |
|
|
|
line |
|
) |
| |
◆ aList
python.readProv.filereader.aList |