Commit 2c1a908f authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[backend][assetmodel] Make use of Asset to handle path

parent 36a46fdf
......@@ -33,6 +33,7 @@ from PyQt5.QtCore import QStringListModel
from ..utils import dataformat_basetypes
from .asset import AssetType
from .asset import Asset
class AssetModel(QStringListModel):
......@@ -197,7 +198,7 @@ class AssetModel(QStringListModel):
:param asset_name str: fully qualified asset name
"""
asset_path = self.asset_type.declaration_path(self.prefix_path, asset_name)
if not os.path.exists(asset_path):
asset = Asset(self.prefix_path, self.asset_type, asset_name)
if not os.path.exists(asset.declaration_path):
raise RuntimeError("Invalid asset {}".format(asset_name))
return asset_path
return asset.declaration_path
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment