Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
calibration
pycalibration
Commits
8171032b
Commit
8171032b
authored
5 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
a fix from testing on prod for no-bool
parent
443ef7d1
No related branches found
No related tags found
1 merge request
!193
a fix from testing on prod for no-bool
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webservice/update_config.py
+2
-5
2 additions, 5 deletions
webservice/update_config.py
with
2 additions
and
5 deletions
webservice/update_config.py
+
2
−
5
View file @
8171032b
import
argparse
import
argparse
import
copy
import
json
import
json
import
sys
import
sys
...
@@ -35,9 +36,6 @@ if "--help" in sys.argv:
...
@@ -35,9 +36,6 @@ if "--help" in sys.argv:
sys
.
argv
.
remove
(
"
--help
"
)
sys
.
argv
.
remove
(
"
--help
"
)
add_help
=
True
add_help
=
True
# Save available_options before adding bool keys with "no-".
prev_available_opt
=
available_options
for
det
,
val
in
available_options
.
items
():
for
det
,
val
in
available_options
.
items
():
bool_keys
=
[]
bool_keys
=
[]
for
k
,
v
in
val
.
items
():
for
k
,
v
in
val
.
items
():
...
@@ -53,7 +51,6 @@ detector = args["detector"]
...
@@ -53,7 +51,6 @@ detector = args["detector"]
if
detector
is
not
None
:
if
detector
is
not
None
:
for
option
,
typ
in
available_options
[
detector
].
items
():
for
option
,
typ
in
available_options
[
detector
].
items
():
if
typ
==
list
:
if
typ
==
list
:
print
(
typ
)
nargs
=
'
+
'
nargs
=
'
+
'
else
:
else
:
nargs
=
None
nargs
=
None
...
@@ -83,7 +80,7 @@ for key, value in args.items():
...
@@ -83,7 +80,7 @@ for key, value in args.items():
value
[
value
.
index
(
v
)]
=
''
.
join
(
v
)
value
[
value
.
index
(
v
)]
=
''
.
join
(
v
)
if
'
no-
'
in
key
and
isinstance
(
value
,
bool
):
if
'
no-
'
in
key
and
isinstance
(
value
,
bool
):
if
key
not
in
prev_available_opt
[
detector
].
keys
()
:
if
key
not
in
bool_
keys
:
new_conf
[
task
][
instrument
][
detector
][
key
.
replace
(
'
no-
'
,
''
)]
=
False
new_conf
[
task
][
instrument
][
detector
][
key
.
replace
(
'
no-
'
,
''
)]
=
False
# avoid saving the "no-"key into the updated config
# avoid saving the "no-"key into the updated config
continue
continue
...
...
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