diff --git a/VERSION b/VERSION index f516d6e5..19d8f8c9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.2-develop11 +1.18.2-develop12 diff --git a/modules/meta.py b/modules/meta.py index aef14829..f137a6b0 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -474,8 +474,16 @@ class DataFile: return og_txt elif str(og_txt) == f"<<{var}>>": return actual_value - elif f"<<{var}>>" in str(og_txt): - return str(og_txt).replace(f"<<{var}>>", str(actual_value)) + elif f"<<{var}" in str(og_txt): + final = str(og_txt).replace(f"<<{var}>>", str(actual_value)) if f"<<{var}>>" in str(og_txt) else str(og_txt) + if f"<<{var}" in final: + match = re.search(f"<<({var}([+-])(\d+))>>", final) + if match: + try: + final = final.replace(f"<<{match.group(1)}>>", str(int(actual_value) + (int(match.group(3)) * (-1 if match.group(2) == "-" else 1)))) + except ValueError: + raise Failed(f"Template Error: {actual_value} must be a number to use {match.group(1)}") + return final else: return og_txt if _debug: