Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
2593d1d8
Commit
2593d1d8
authored
Mar 28, 2019
by
Samuel GAIST
Browse files
[backend][assetmodel] Also load basetypes for dataformats
parent
7d09f2c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/backend/assetmodel.py
View file @
2593d1d8
...
...
@@ -24,6 +24,8 @@
###############################################################################
import
os
import
simplejson
as
json
import
pkg_resources
from
enum
import
Enum
,
unique
...
...
@@ -156,7 +158,18 @@ class AssetModel(QStringListModel):
)
)
self
.
setStringList
(
sorted
(
latest_assets_list
))
latest_assets_list
=
sorted
(
latest_assets_list
)
if
self
.
asset_type
==
AssetType
.
DATAFORMAT
:
# Load basetypes
common_data
=
pkg_resources
.
resource_string
(
"beat.core"
,
"schema/common/1.json"
)
common_data
=
json
.
loads
(
common_data
)
basetypes
=
common_data
[
"definitions"
][
"basetype"
][
"enum"
]
print
(
basetypes
)
latest_assets_list
=
basetypes
+
latest_assets_list
self
.
setStringList
(
latest_assets_list
)
def
assetType
(
self
):
"""Returns the asset type of this model
...
...
Write
Preview
Markdown
is supported
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