Commit ef4919fc authored by Philippe SWARTVAGHER's avatar Philippe SWARTVAGHER
Browse files

FilesParser: handle files with first lines not starting with #

parent 585511c7
......@@ -380,7 +380,15 @@ class FilesParser:
run_values = {}
for k in infos:
meet_sharp = False
for l in lines:
if l.startswith("# "):
meet_sharp = True
elif meet_sharp:
# we parsed all the header of the file that could contains these informations,
# no need to parse the whole file
break
if l.startswith(infos[k]):
v = int(l[l.find(":")+1:].split()[0])
if self.machine[k] is None:
......@@ -389,21 +397,20 @@ class FilesParser:
print("Warning: {} is different ({} vs {})".format(
k, self.machine['k'], v
))
break
elif not l.startswith("# "):
# we parsed the beginning of the file that could contains these informations,
# no need to parse the whole file
break
break
for k in run:
meet_sharp = False
for l in lines:
if l.startswith("# "):
meet_sharp = True
elif meet_sharp:
# we parsed all the header of the file that could contains these informations,
# no need to parse the whole file
break
if l.startswith(run[k]):
run_values[k] = int(l[l.find(":")+1:].split()[0])
break
elif not l.startswith("# "):
# we parsed the beginning of the file that could contains these informations,
# no need to parse the whole file
break
return run_values
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment