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

count lines and their match classification

parent b3e49012
Branches
Tags
No related merge requests found
......@@ -24,6 +24,9 @@ class Annotator(object):
self._formatNameWidth = formatNameWidth
self._formatSourceWidth = formatSourceWidth
self._update_annotate_format()
self.counter = {}
for counter in ['total', 'ignore', 'match', 'partial', 'unmatched']:
self.counter[counter] = 0
def _update_annotate_format(self):
self._annotate_format = '%%%ds:%%04d %%%ds %%9s|%%s' % (
......@@ -61,6 +64,18 @@ class Annotator(object):
global_ignore = True
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
matchlabel = ''
if local_ignore:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment