mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-09 19:54:17 +00:00
implement recursive variables for #83
This commit is contained in:
@@ -57,6 +57,10 @@ class Templategen:
|
||||
return ''
|
||||
return self.env.from_string(string).render()
|
||||
|
||||
def update_variables(self, variables):
|
||||
"""update variables"""
|
||||
self.env.globals.update(variables)
|
||||
|
||||
def _header(self, prepend=''):
|
||||
"""add a comment usually in the header of a dotfile"""
|
||||
return '{}{}'.format(prepend, utils.header())
|
||||
@@ -125,6 +129,11 @@ class Templategen:
|
||||
return True
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def var_is_template(string):
|
||||
"""check if variable contains template(s)"""
|
||||
return VAR_START in str(string)
|
||||
|
||||
@staticmethod
|
||||
def _is_template(path):
|
||||
"""test if file pointed by path is a template"""
|
||||
|
||||
Reference in New Issue
Block a user