[Zope3-checkins] CVS: Zope3/src/zope/tal - dummyengine.py:1.16
interfaces.py:1.11
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Mar 23 14:18:48 EST 2004
Update of /cvs-repository/Zope3/src/zope/tal
In directory cvs.zope.org:/tmp/cvs-serv17868/src/zope/tal
Modified Files:
dummyengine.py interfaces.py
Log Message:
Added getValue(name, default) to engine.
=== Zope3/src/zope/tal/dummyengine.py 1.15 => 1.16 ===
--- Zope3/src/zope/tal/dummyengine.py:1.15 Mon Mar 8 18:33:58 2004
+++ Zope3/src/zope/tal/dummyengine.py Tue Mar 23 14:18:17 2004
@@ -80,6 +80,12 @@
def setGlobal(self, name, value):
self.globals[name] = value
+ def getValue(self, name, default=None):
+ value = self.globals.get(name, default)
+ if value is default:
+ value = self.locals.get(name, default)
+ return value
+
def evaluate(self, expression):
assert (expression.startswith("$") and expression.endswith("$"),
expression)
=== Zope3/src/zope/tal/interfaces.py 1.10 => 1.11 ===
--- Zope3/src/zope/tal/interfaces.py:1.10 Thu Aug 21 10:19:29 2003
+++ Zope3/src/zope/tal/interfaces.py Tue Mar 23 14:18:17 2004
@@ -141,6 +141,12 @@
The variable will be named 'name' and have the value 'value'.
"""
+ def getValue(name, default=None):
+ """Get a variable by name.
+
+ If the variable does not exist, return default.
+ """
+
def setRepeat(name, compiled_expression):
"""Start a repetition, returning an ITALIterator.
More information about the Zope3-Checkins
mailing list