summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f2624b5)
raw | patch | inline | side by side (parent: f2624b5)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 10 Oct 2002 03:48:02 +0000 (03:48 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 10 Oct 2002 03:48:02 +0000 (03:48 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1330 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi/PageTemplates/PythonExpr.py | patch | blob | history | |
roundup/cgi/PageTemplates/TALES.py | patch | blob | history |
index a8f06d516be4c943641806ba81ce772ff2d8d189..0bfe40034b35e3525a70bf8c4084bb54d8b79560 100644 (file)
"""
-__version__='$Revision: 1.3 $'[11:-2]
+__version__='$Revision: 1.4 $'[11:-2]
from TALES import CompilerError
from string import strip, split, join, replace, lstrip
# Bind template variables
names = {}
vars = econtext.vars
- getType = econtext._engine.getTypes().get
+ getType = econtext.getCompiler().getTypes().get
for vname in self._f_varnames:
has, val = vars.has_get(vname)
if not has:
self._econtext = econtext
def __call__(self, text):
return self._handler(self._name, text,
- self._econtext._engine)(self._econtext)
+ self._econtext.getCompiler())(self._econtext)
index d29e8a76f51d38024f428fa8d9fa49dd7a86e137..229064c79400243730bf00e90245906fba84e843 100644 (file)
- changed imports to import from roundup.cgi
"""
-__version__='$Revision: 1.3 $'[11:-2]
+__version__='$Revision: 1.4 $'[11:-2]
import re, sys
from roundup.cgi import ZTUtils
position = (None, None)
source_file = None
- def __init__(self, engine, contexts):
- self._engine = engine
+ def __init__(self, compiler, contexts):
+ self._compiler = compiler
self.contexts = contexts
contexts['nothing'] = None
contexts['default'] = Default
# Keep track of what needs to be popped as each scope ends.
self._scope_stack = []
+ def getCompiler(self):
+ return self._compiler
+
def beginScope(self):
self._scope_stack.append([self.local_vars.copy()])
def setRepeat(self, name, expr):
expr = self.evaluate(expr)
if not expr:
- return self._engine.Iterator(name, (), self)
- it = self._engine.Iterator(name, expr, self)
+ return self._compiler.Iterator(name, (), self)
+ it = self._compiler.Iterator(name, expr, self)
old_value = self.repeat_vars.get(name)
self._scope_stack[-1].append((name, old_value))
self.repeat_vars[name] = it
def evaluate(self, expression,
isinstance=isinstance, StringType=StringType):
if isinstance(expression, StringType):
- expression = self._engine.compile(expression)
+ expression = self._compiler.compile(expression)
__traceback_supplement__ = (
TALESTracebackSupplement, self, expression)
v = expression(self)