From bf0f11e9925faab3da97d5b5e1cfafabb7bf2b90 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 10 Apr 2019 19:13:00 +0200 Subject: [PATCH] on task fill returns path up to first unfilled key & added path log --- pype/ftrack/actions/action_create_folders.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pype/ftrack/actions/action_create_folders.py b/pype/ftrack/actions/action_create_folders.py index 15ca86809d..f7620cd609 100644 --- a/pype/ftrack/actions/action_create_folders.py +++ b/pype/ftrack/actions/action_create_folders.py @@ -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('{')