Skip to content

Commit

Permalink
#6 allowing template interpreter to interpret common Python commands
Browse files Browse the repository at this point in the history
  • Loading branch information
micahellison committed Apr 10, 2020
1 parent b56026d commit ccf0b7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jrnl/plugins/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def render_block(self, block, **vars):
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

Expand Down

0 comments on commit ccf0b7e

Please sign in to comment.