mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added better condition for full replacements
This commit is contained in:
parent
5b60e7f172
commit
cd1bf6d302
1 changed files with 3 additions and 1 deletions
|
|
@ -129,6 +129,7 @@ def _fill_schema_template_data(
|
|||
elif isinstance(template, STRING_TYPE):
|
||||
# TODO find much better way how to handle filling template data
|
||||
template = template.replace("{{", "__dbcb__").replace("}}", "__decb__")
|
||||
full_replacement = False
|
||||
for replacement_string in template_key_pattern.findall(template):
|
||||
key = str(replacement_string[1:-1])
|
||||
required_keys.add(key)
|
||||
|
|
@ -141,11 +142,12 @@ def _fill_schema_template_data(
|
|||
# Replace the value with value from templates data
|
||||
# - with this is possible to set value with different type
|
||||
template = value
|
||||
full_replacement = True
|
||||
else:
|
||||
# Only replace the key in string
|
||||
template = template.replace(replacement_string, value)
|
||||
|
||||
if isinstance(template, STRING_TYPE):
|
||||
if not full_replacement:
|
||||
output = template.replace("__dbcb__", "{").replace("__decb__", "}")
|
||||
else:
|
||||
output = template
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue