Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
faab3c71
Commit
faab3c71
authored
Oct 02, 2019
by
Samuel GAIST
Browse files
[widgets][plottereditor] Make resistant to "empty" JSON
Empty as in "{}"
parent
6be11db0
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/widgets/plottereditor.py
View file @
faab3c71
...
...
@@ -210,15 +210,12 @@ class PlotterEditor(AbstractAssetEditor):
self
.
language
=
json_object
.
get
(
"language"
,
""
)
selected_dataformat
=
json_object
.
get
(
"dataformat"
,
{}
)
selected_dataformat
=
json_object
.
get
(
"dataformat"
,
""
)
index
=
self
.
dataformat_combobox
.
findText
(
selected_dataformat
,
Qt
.
MatchFixedString
)
if
index
>=
0
:
self
.
dataformat_combobox
.
setCurrentIndex
(
index
)
else
:
raise
RuntimeError
(
"Invalid default value"
)
self
.
dataformat_combobox
.
setCurrentIndex
(
index
)
self
.
libraries_widget
.
set_available_libraries
(
self
.
library_model
.
stringList
())
self
.
libraries_widget
.
set_used_libraries
(
json_object
.
get
(
"uses"
,
{}))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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