mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 13:08:31 +02:00
Delay import of asteval
This commit is contained in:
parent
de52081481
commit
80b376b4fb
1 changed files with 1 additions and 1 deletions
|
@ -1,5 +1,4 @@
|
||||||
import re
|
import re
|
||||||
import asteval
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
VAR_RE = r"[_a-zA-Z][a-zA-Z0-9_]*"
|
VAR_RE = r"[_a-zA-Z][a-zA-Z0-9_]*"
|
||||||
|
@ -39,6 +38,7 @@ class Template(object):
|
||||||
return self._expand(self.blocks[block], **vars)
|
return self._expand(self.blocks[block], **vars)
|
||||||
|
|
||||||
def _eval_context(self, vars):
|
def _eval_context(self, vars):
|
||||||
|
import asteval
|
||||||
e = asteval.Interpreter(use_numpy=False, writer=None)
|
e = asteval.Interpreter(use_numpy=False, writer=None)
|
||||||
e.symtable.update(vars)
|
e.symtable.update(vars)
|
||||||
e.symtable['__last_iteration'] = vars.get("__last_iteration", False)
|
e.symtable['__last_iteration'] = vars.get("__last_iteration", False)
|
||||||
|
|
Loading…
Add table
Reference in a new issue