mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
on task fill returns path up to first unfilled key & added path log
This commit is contained in:
parent
7a26a52358
commit
bf0f11e992
1 changed files with 10 additions and 4 deletions
|
|
@ -195,12 +195,14 @@ class CreateFolders(BaseAction):
|
|||
app_data['app'] = app
|
||||
collected_paths.append(
|
||||
self.compute_template(
|
||||
template_publish, app_data
|
||||
template_publish, app_data, True
|
||||
)
|
||||
)
|
||||
if template_publish_created is False:
|
||||
collected_paths.append(
|
||||
self.compute_template(template_publish, task_data)
|
||||
self.compute_template(
|
||||
template_publish, task_data, True
|
||||
)
|
||||
)
|
||||
|
||||
if not tasks_created:
|
||||
|
|
@ -211,8 +213,10 @@ class CreateFolders(BaseAction):
|
|||
collected_paths.append(
|
||||
self.compute_template(template_publish, ent_data)
|
||||
)
|
||||
|
||||
if len(collected_paths) > 0:
|
||||
self.log.info('Creating folders:')
|
||||
for path in set(collected_paths):
|
||||
self.log.info(path)
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
|
||||
|
|
@ -298,10 +302,12 @@ class CreateFolders(BaseAction):
|
|||
|
||||
return solved
|
||||
|
||||
def compute_template(self, str, data):
|
||||
def compute_template(self, str, data, task=False):
|
||||
first_result = self.template_format(str, data)
|
||||
if first_result == first_result.split('{')[0]:
|
||||
return os.path.normpath(first_result)
|
||||
if task:
|
||||
return os.path.normpath(first_result.split('{')[0])
|
||||
|
||||
index = first_result.index('{')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue