[35] add mapping name and the overrides to template variables

pull/1400/head
meisnate12 2 years ago
parent e64520f7f8
commit 8c488762c2

@ -1 +1 @@
1.19.0-develop34 1.19.0-develop35

@ -99,9 +99,11 @@ templates:
- url_background - url_background
- file_background - file_background
- limit - limit
- mapping_name
run_definition: run_definition:
- <<use_<<key>>>> - <<use_<<key>>>>
- <<allowed_libraries>> - <<allowed_libraries>>
mapping_name: <<mapping_name>>
translation_key: <<translation_key>> translation_key: <<translation_key>>
key_name: <<key_name>> key_name: <<key_name>>
summary: <<summary_<<key>>>> summary: <<summary_<<key>>>>

@ -1042,8 +1042,16 @@ class MetadataFile(DataFile):
methods["title_override"] = methods.pop("post_format_override") methods["title_override"] = methods.pop("post_format_override")
if "pre_format_override" in methods: if "pre_format_override" in methods:
methods["key_name_override"] = methods.pop("pre_format_override") 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 {} title_override = {}
key_name_override = util.parse("Config", "key_name_override", dynamic, parent=map_name, methods=methods, datatype="strdict") if "key_name_override" in methods else {} 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 = [] test_override = []
for k, v in key_name_override.items(): for k, v in key_name_override.items():
if v in test_override: if v in test_override:

Loading…
Cancel
Save