From 8c488762c262c302850905fe3b234687b5c4c72a Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 26 Apr 2023 10:05:08 -0400 Subject: [PATCH] [35] add mapping name and the overrides to template variables --- VERSION | 2 +- defaults/templates.yml | 2 ++ modules/meta.py | 12 ++++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index cecac8f2..506765af 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.19.0-develop34 +1.19.0-develop35 diff --git a/defaults/templates.yml b/defaults/templates.yml index 0452106b..e09a899f 100644 --- a/defaults/templates.yml +++ b/defaults/templates.yml @@ -99,9 +99,11 @@ templates: - url_background - file_background - limit + - mapping_name run_definition: - <>>> - <> + mapping_name: <> translation_key: <> key_name: <> summary: <>>> diff --git a/modules/meta.py b/modules/meta.py index 3caa682a..fe013a33 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -1042,8 +1042,16 @@ class MetadataFile(DataFile): methods["title_override"] = methods.pop("post_format_override") if "pre_format_override" in methods: methods["key_name_override"] = methods.pop("pre_format_override") - title_override = util.parse("Config", "title_override", dynamic, parent=map_name, methods=methods, datatype="strdict") if "title_override" in methods else {} - key_name_override = util.parse("Config", "key_name_override", dynamic, parent=map_name, methods=methods, datatype="strdict") if "key_name_override" in methods else {} + title_override = {} + if "title_override" in self.temp_vars: + title_override = util.parse("Config", "title_override", self.temp_vars["title_override"], parent="template_variables", datatype="strdict") + elif "title_override" in methods: + title_override = util.parse("Config", "title_override", dynamic, parent=map_name, methods=methods, datatype="strdict") + key_name_override = {} + if "key_name_override" in self.temp_vars: + key_name_override = util.parse("Config", "key_name_override", self.temp_vars["key_name_override"], parent="template_variables", datatype="strdict") + elif "key_name_override" in methods: + key_name_override = util.parse("Config", "key_name_override", dynamic, parent=map_name, methods=methods, datatype="strdict") test_override = [] for k, v in key_name_override.items(): if v in test_override: