Skip to content
Snippets Groups Projects
Commit 07ec6298 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[utils] Add asset_type and asset_folder to Storage

This will centralize the information and avoid duplicating
strings everywhere when one needs data from one of the various
assets.
parent 6c5084f5
No related branches found
No related tags found
1 merge request!46Improve asset information
......@@ -219,8 +219,16 @@ class File(object):
class Storage(object):
"""Resolves paths for objects that provide only a description"""
asset_type = None
asset_folder = None
def __init__(self, path):
if not all(
[type(attr) == str for attr in [self.asset_type, self.asset_folder]]
):
raise TypeError("asset_type and asset_folder must be configure properly")
self.path = path
self.json = File(self.path + ".json")
self.doc = File(self.path + ".rst")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment