Added additional template variables

Added two additional template variables
* template_fullpath - absolute path to the template
* template_run_date - date that the template was rendered
Documented these additional variables in the module documentation
This commit is contained in:
willthames 2013-01-04 16:26:11 +10:00
parent caee51e90e
commit 411b2bf7d9
2 changed files with 6 additions and 3 deletions

View file

@ -303,6 +303,8 @@ def template_from_file(basedir, path, vars):
vars['template_path'] = realpath
vars['template_mtime'] = datetime.datetime.fromtimestamp(os.path.getmtime(realpath))
vars['template_uid'] = template_uid
vars['template_fullpath'] = os.path.abspath(realpath)
vars['template_run_date'] = datetime.datetime.now()
managed_default = C.DEFAULT_MANAGED_STR
managed_str = managed_default.format(