Expression Engine¶
-
class
zope.tales.tales.Context(engine, contexts)[source]¶ Bases:
objectExpression engine, an implementation of
zope.tal.interfaces.ITALExpressionEngine.This class is called
Contextbecause an instance of this class holds context information (namespaces) that it uses when evaluating compiled expressions.Parameters: - engine – A
ExpressionEngine(azope.tal.interfaces.ITALExpressionCompiler) - contexts – A mapping (namespace) of variables that forms the base variable scope.
-
setContext(name, value)[source]¶ Hook to allow subclasses to do things like adding security proxies.
-
evaluate(expression)[source]¶ Evaluate the expression by calling it, passing in this object, and return the raw results.
If expression is a string, it is first compiled.
-
evaluateValue(expression)¶ Evaluate the expression by calling it, passing in this object, and return the raw results.
If expression is a string, it is first compiled.
-
evaluateStructure(expression)¶ Evaluate the expression by calling it, passing in this object, and return the raw results.
If expression is a string, it is first compiled.
-
evaluateMacro(expression)¶ Evaluate the expression by calling it, passing in this object, and return the raw results.
If expression is a string, it is first compiled.
- engine – A
Exceptions¶
A number of exceptions are defined.
-
class
zope.tales.tales.TALESError[source]¶ Bases:
exceptions.ExceptionError during TALES evaluation
-
class
zope.tales.tales.Undefined[source]¶ Bases:
zope.tales.tales.TALESErrorException raised on traversal of an undefined path
-
class
zope.tales.tales.CompilerError[source]¶ Bases:
exceptions.ExceptionTALES Compiler Error
-
class
zope.tales.tales.RegistrationError[source]¶ Bases:
exceptions.ExceptionExpression type or base name registration Error