From 0a3a9241d5de972e85c8d0596cae680b03d6909d Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Sat, 18 May 2019 13:40:59 -0700 Subject: [PATCH] allowing template interpreter to interpret common Python commands from template (such as len) #594 --- jrnl/plugins/template.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jrnl/plugins/template.py b/jrnl/plugins/template.py index f54f481a..21fb2896 100644 --- a/jrnl/plugins/template.py +++ b/jrnl/plugins/template.py @@ -39,7 +39,8 @@ class Template(object): return self._expand(self.blocks[block], **vars) def _eval_context(self, vars): - e = asteval.Interpreter(symtable=vars, use_numpy=False, writer=None) + e = asteval.Interpreter(use_numpy=False, writer=None) + e.symtable.update(vars) e.symtable['__last_iteration'] = vars.get("__last_iteration", False) return e