mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-07 12:48:32 +00:00
adding ability to use variables from the config file in templates
This commit is contained in:
@@ -22,7 +22,7 @@ COMMENT_END = '@@#}'
|
||||
|
||||
class Templategen:
|
||||
|
||||
def __init__(self, base='.', debug=False):
|
||||
def __init__(self, base='.', variables={}, debug=False):
|
||||
self.base = base.rstrip(os.sep)
|
||||
self.debug = debug
|
||||
loader = FileSystemLoader(self.base)
|
||||
@@ -36,6 +36,7 @@ class Templategen:
|
||||
comment_start_string=COMMENT_START,
|
||||
comment_end_string=COMMENT_END)
|
||||
self.env.globals['header'] = self._header
|
||||
self.env.globals.update(variables)
|
||||
self.log = Logger()
|
||||
|
||||
def generate(self, src, profile):
|
||||
|
||||
Reference in New Issue
Block a user