ignore lines not fitting the regex when parsing lines from .cnt file
This commit is contained in:
parent
3407f03091
commit
fc9978b484
1 changed files with 4 additions and 1 deletions
|
@ -11,7 +11,10 @@ def parse_counters(filepath: Path, break_point: Dict) -> Dict:
|
||||||
counters: Dict = {}
|
counters: Dict = {}
|
||||||
with open(filepath) as f:
|
with open(filepath) as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
counter, _, num = re.search(r"(.*): (\d*\.)*?(\d*)", line).groups()
|
match = re.search(r"(.*): (\d*\.)*?(\d+)", line)
|
||||||
|
if not match:
|
||||||
|
continue
|
||||||
|
counter, _, num = match.groups()
|
||||||
num = int(num)
|
num = int(num)
|
||||||
if counter in break_point and num >= break_point[counter]:
|
if counter in break_point and num >= break_point[counter]:
|
||||||
return counters
|
return counters
|
||||||
|
|
Loading…
Reference in a new issue