From bb4b975bf59692bf752bbedcd88c850e13988e6b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 9 Jul 2025 15:17:56 +0200 Subject: [PATCH] added explaining comment --- client/ayon_core/pipeline/workfile/path_resolving.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/ayon_core/pipeline/workfile/path_resolving.py b/client/ayon_core/pipeline/workfile/path_resolving.py index 3f7d23f07f..a13fe6b5cc 100644 --- a/client/ayon_core/pipeline/workfile/path_resolving.py +++ b/client/ayon_core/pipeline/workfile/path_resolving.py @@ -249,7 +249,14 @@ class WorkfileDataParser: file_template = re.sub(pattern, replacement, file_template) file_template = StringTemplate(file_template) + # Prepare template that does contain 'comment' comment_template = re.escape(str(file_template.format_strict(data))) + # Prepare template that does not contain 'comment' + # - comment is usually marked as optional and in that case the regex + # to find the comment is different based on the filename + # - if filename contains comment then 'comment_template' will match + # - if filename does not contain comment then 'file_template' will + # match data.pop("comment") file_template = re.escape(str(file_template.format_strict(data))) for src, replacement in (