1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-05 14:58:48 +00:00

add ability to template dotpath for #346

This commit is contained in:
deadc0de6
2022-05-26 22:23:07 +02:00
committed by deadc0de
parent 76d056ffd5
commit cd3a1a26a2
2 changed files with 130 additions and 2 deletions

View File

@@ -222,6 +222,13 @@ class CfgYaml:
title = 'variables defined (after template include)'
self._debug_dict(title, self.variables)
##################################################
# template config entries
##################################################
entry = self.settings[self.key_settings_dotpath]
val = self._template_item(entry)
self.settings[self.key_settings_dotpath] = val
##################################################
# parse the other blocks
##################################################
@@ -1273,8 +1280,12 @@ class CfgYaml:
def _redefine_templater(self):
"""create templater based on current variables"""
fufile = self.settings[Settings.key_func_file]
fifile = self.settings[Settings.key_filter_file]
fufile = None
fifile = None
if Settings.key_func_file in self.settings:
fufile = self.settings[Settings.key_func_file]
if Settings.key_filter_file in self.settings:
fifile = self.settings[Settings.key_filter_file]
self._tmpl = Templategen(variables=self.variables,
func_file=fufile,
filter_file=fifile)