1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-06 14:52:57 +00:00

adding ability to use variables from the config file in templates

This commit is contained in:
deadc0de6
2018-09-01 18:28:53 +02:00
parent 9f3da3c8b7
commit 8a3e7459f3
7 changed files with 137 additions and 5 deletions

View File

@@ -38,6 +38,9 @@ class Cfg:
# transformations keys
key_trans = 'trans'
# template variables
key_variables = 'variables'
# dotfiles keys
key_dotfiles = 'dotfiles'
key_dotfiles_src = 'src'
@@ -479,6 +482,11 @@ class Cfg:
"""return all defined settings"""
return self.lnk_settings.copy()
def get_variables(self):
if self.key_variables in self.content:
return self.content[self.key_variables]
return {}
def dump(self):
"""return a dump of the config"""
# temporary reset dotpath