Skip to content
Snippets Groups Projects

Implement ProtocolTemplateEditor

Merged Samuel GAIST requested to merge 210_implement_protocoltemplate_editor into v2
Files
6
@@ -247,3 +247,14 @@ class AssetModel(QStringListModel):
"""Returns the folder matching this model asset type"""
return os.path.join(self.prefix_path, AssetType.path(self.asset_type))
def json_path(self, asset_name):
"""Returns the full path to the json file matching the asset given
:param asset_name str: fully qualified asset name
"""
asset_path = os.path.join(self.asset_folder, "{}.json".format(asset_name))
if not os.path.exists(asset_path):
raise RuntimeError("Invalid asset {}".format(asset_name))
return asset_path
Loading