Skip to content
Snippets Groups Projects
Commit 2c85894f authored by Henning Glawe's avatar Henning Glawe
Browse files

count lines and their match classification

parent aad167e3
Branches
No related tags found
No related merge requests found
...@@ -24,6 +24,9 @@ class Annotator(object): ...@@ -24,6 +24,9 @@ class Annotator(object):
self._formatNameWidth = formatNameWidth self._formatNameWidth = formatNameWidth
self._formatSourceWidth = formatSourceWidth self._formatSourceWidth = formatSourceWidth
self._update_annotate_format() self._update_annotate_format()
self.counter = {}
for counter in ['total', 'ignore', 'match', 'partial', 'unmatched']:
self.counter[counter] = 0
def _update_annotate_format(self): def _update_annotate_format(self):
self._annotate_format = '%%%ds:%%04d %%%ds %%9s|%%s' % ( self._annotate_format = '%%%ds:%%04d %%%ds %%9s|%%s' % (
...@@ -61,6 +64,18 @@ class Annotator(object): ...@@ -61,6 +64,18 @@ class Annotator(object):
global_ignore = True global_ignore = True
match = m2 match = m2
# update counters
self.counter['total'] += 1
if local_ignore or global_ignore:
self.counter['ignore'] += 1
elif match:
if full:
self.counter['match'] += 1
else:
self.counter['partial'] += 1
else:
self.counter['unmatched'] += 1
# setup match label # setup match label
matchlabel = '' matchlabel = ''
if local_ignore: if local_ignore:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment