Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xin Wang
codes-dev
Commits
406bab44
Commit
406bab44
authored
Mar 28, 2014
by
Jonathan Jenkins
Browse files
extended opts for config filter
parent
da5b6b71
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/codes_filter_configs.py
View file @
406bab44
...
...
@@ -33,6 +33,11 @@ def main():
if
k
not
in
cfg
.
replace_map
:
raise
ValueError
(
"key "
+
k
+
" not in original config"
)
# hack - if we are using an output prefix, append the "dot" here
if
args
.
output_prefix
==
None
:
args
.
output_prefix
=
""
else
:
args
.
output_prefix
=
args
.
output_prefix
+
'.'
# filter out the files
# (cfg iterator returns nothing, eval'd for side effects)
for
i
,
_
in
enumerate
(
cfg
):
...
...
@@ -40,13 +45,14 @@ def main():
if
tdict
[
k
]
!=
cfg
.
replace_map
[
k
]:
break
else
:
stdout
.
write
(
args
.
output_prefix
+
"."
+
str
(
i
)
+
"
\n
"
)
stdout
.
write
(
args
.
output_prefix
+
str
(
i
)
+
"
\n
"
)
def
parse_args
():
parser
=
argparse
.
ArgumentParser
(
\
description
=
"emit configuration files to stdout matching given "
"token values"
)
parser
.
add_argument
(
"output_prefix"
,
help
=
"prefix of output config files"
)
parser
.
add_argument
(
"-o"
,
"--output_prefix"
,
help
=
"prefix of output config "
"files (Default: print only the filtered indices)"
,
type
=
str
)
parser
.
add_argument
(
"substitute_py"
,
help
=
"input python file given to codes_configurator.py - see "
"codes_configurator.py for details"
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment