Merged in feature/PYPE-184_format_path_silotasks (pull request #63)

hierarchy is set to empty string if no parents

Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
Jakub Trllo 2019-02-11 22:09:03 +00:00 committed by Milan Kolar
commit a620acac87
5 changed files with 23 additions and 13 deletions

View file

@ -167,14 +167,16 @@ def get_hierarchy():
string: asset hierarchy path
"""
hierarchy = io.find_one({
parents = io.find_one({
"type": 'asset',
"name": get_asset()}
)['data']['parents']
if hierarchy:
hierarchy = ""
if parents and len(parents) > 0:
# hierarchy = os.path.sep.join(hierarchy)
return os.path.join(*hierarchy).replace("\\", "/")
hierarchy = os.path.join(*parents).replace("\\", "/")
return hierarchy
def set_hierarchy(hierarchy):