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
GitLab 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
04a5a907
Commit
04a5a907
authored
9 years ago
by
Henning Glawe
Browse files
Options
Downloads
Patches
Plain Diff
make coverageIgnore constructor kwarg of Annotator
parent
08fd09ac
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/python/nomadcore/annotator.py
+3
-7
3 additions, 7 deletions
common/python/nomadcore/annotator.py
common/python/nomadcore/simple_parser.py
+4
-1
4 additions, 1 deletion
common/python/nomadcore/simple_parser.py
with
7 additions
and
8 deletions
common/python/nomadcore/annotator.py
+
3
−
7
View file @
04a5a907
...
@@ -6,8 +6,9 @@ LOGGER = logging.getLogger(__name__)
...
@@ -6,8 +6,9 @@ LOGGER = logging.getLogger(__name__)
class
Annotator
(
object
):
class
Annotator
(
object
):
def
__init__
(
self
,
annotateFilename
=
None
):
def
__init__
(
self
,
annotateFilename
=
None
,
coverageIgnore
=
None
):
self
.
matchHighlighter
=
MatchHighlighter
()
self
.
matchHighlighter
=
MatchHighlighter
()
self
.
coverageIgnore
=
coverageIgnore
if
annotateFilename
is
None
:
if
annotateFilename
is
None
:
self
.
annotateFile
=
None
self
.
annotateFile
=
None
else
:
else
:
...
@@ -18,13 +19,8 @@ class Annotator(object):
...
@@ -18,13 +19,8 @@ class Annotator(object):
def
annotate
(
self
,
match
,
line
,
parser
,
matcher
,
targetStartEnd
):
def
annotate
(
self
,
match
,
line
,
parser
,
matcher
,
targetStartEnd
):
if
not
self
.
annotateFile
:
if
not
self
.
annotateFile
:
return
1
return
1
coverageIgnore
=
None
try
:
coverageIgnore
=
parser
.
superContext
.
coverageIgnore
except
AttributeError
:
pass
(
matchtype
,
highlightedLine
)
=
self
.
matchHighlighter
.
highlight
(
(
matchtype
,
highlightedLine
)
=
self
.
matchHighlighter
.
highlight
(
match
,
line
,
coverageIgnore
)
match
,
line
,
self
.
coverageIgnore
)
matchlabel
=
''
matchlabel
=
''
if
matchtype
==
0
:
if
matchtype
==
0
:
matchlabel
=
'
ign
'
matchlabel
=
'
ign
'
...
...
This diff is collapsed.
Click to expand it.
common/python/nomadcore/simple_parser.py
+
4
−
1
View file @
04a5a907
...
@@ -960,11 +960,14 @@ class SimpleParser(object):
...
@@ -960,11 +960,14 @@ class SimpleParser(object):
self
.
superContext
=
superContext
self
.
superContext
=
superContext
self
.
lastMatch
=
{}
self
.
lastMatch
=
{}
annofilename
=
None
annofilename
=
None
coverageIgnore
=
None
if
annotate
:
if
annotate
:
annofilename
=
fIn
.
fIn
.
name
+
"
.annotate
"
annofilename
=
fIn
.
fIn
.
name
+
"
.annotate
"
coverageIgnore
=
getattr
(
superContext
,
'
coverageIgnore
'
,
None
)
else
:
else
:
logger
.
info
(
"
no annotations requested for
"
+
fIn
.
fIn
.
name
)
logger
.
info
(
"
no annotations requested for
"
+
fIn
.
fIn
.
name
)
self
.
annotator
=
Annotator
(
annotateFilename
=
annofilename
)
self
.
annotator
=
Annotator
(
annotateFilename
=
annofilename
,
coverageIgnore
=
coverageIgnore
)
def
enterInState
(
self
,
stateIndex
):
def
enterInState
(
self
,
stateIndex
):
compiledMatcher
=
self
.
parserBuilder
.
compiledMatchers
[
stateIndex
]
compiledMatcher
=
self
.
parserBuilder
.
compiledMatchers
[
stateIndex
]
...
...
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