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
parent 6c5084f5
......@@ -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")
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