Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nomad-lab
python-common
Commits
f3d8babb
Commit
f3d8babb
authored
8 years ago
by
Henning Glawe
Browse files
Options
Downloads
Patches
Plain Diff
count lines and their match classification
parent
b3e49012
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/python/nomadcore/annotator.py
+15
-0
15 additions, 0 deletions
common/python/nomadcore/annotator.py
with
15 additions
and
0 deletions
common/python/nomadcore/annotator.py
+
15
−
0
View file @
f3d8babb
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment