Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NLMaps Tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
Simon Will
NLMaps Tools
Commits
cffe213a
Commit
cffe213a
authored
3 years ago
by
Simon Will
Browse files
Options
Downloads
Patches
Plain Diff
Add more informational output to fix_nlmaps_v2.py
parent
a117e2bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nlmaps_tools/fix_nlmaps_v2.py
+16
-0
16 additions, 0 deletions
nlmaps_tools/fix_nlmaps_v2.py
with
16 additions
and
0 deletions
nlmaps_tools/fix_nlmaps_v2.py
+
16
−
0
View file @
cffe213a
...
...
@@ -108,12 +108,18 @@ def get_findkey_value(mrl):
def
main
(
mrl_infile
,
en_infile
,
mrl_outfile
,
en_outfile
,
quiet
=
False
):
deleted
=
0
modified
=
0
total
=
0
with
open
(
mrl_infile
)
as
mrl_inf
,
open
(
en_infile
)
as
en_inf
,
\
open
(
mrl_outfile
,
'
w
'
)
as
mrl_outf
,
open
(
en_outfile
,
'
w
'
)
as
en_outf
:
for
mrl
,
en
in
zip
(
mrl_inf
,
en_inf
):
mrl
=
mrl
.
strip
()
en
=
en
.
strip
()
total
+=
1
orig_mrl
=
mrl
findkey_value
=
get_findkey_value
(
mrl
)
if
findkey_value
and
findkey_value
not
in
FINDKEY_WHITELIST
:
prefix
=
findkey_value
.
replace
(
'
_
'
,
'
'
).
replace
(
'
:
'
,
'
'
)
...
...
@@ -121,11 +127,13 @@ def main(mrl_infile, en_infile, mrl_outfile, en_outfile, quiet=False):
if
en
.
startswith
(
prefix
):
if
not
quiet
:
print
(
'
Deleting:
'
,
en
)
deleted
+=
1
continue
if
has_unfixable_deprecated_tag
(
mrl
):
if
not
quiet
:
print
(
'
Deleting:
'
,
en
)
deleted
+=
1
continue
for
sub
in
SUBSTITUTIONS
:
...
...
@@ -140,6 +148,14 @@ def main(mrl_infile, en_infile, mrl_outfile, en_outfile, quiet=False):
print
(
mrl
,
file
=
mrl_outf
)
print
(
en
,
file
=
en_outf
)
if
mrl
!=
orig_mrl
:
modified
+=
1
if
not
quiet
:
print
(
'
Total:
'
,
total
)
print
(
'
Modified:
'
,
modified
)
print
(
'
Deleted:
'
,
deleted
)
def
parse_args
():
parser
=
argparse
.
ArgumentParser
(
description
=
'
Fix errors in NLMaps v2
'
)
...
...
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