[Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/ A quick and dirty fix for the macro problem, that may or may not work.

Lennart Regebro regebro at gmail.com
Fri Apr 21 13:46:24 EDT 2006


Log message for revision 67240:
  A quick and dirty fix for the macro problem, that may or may not work.
  

Changed:
  U   Zope/trunk/lib/python/Products/PageTemplates/TALES.py
  U   Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py

-=-
Modified: Zope/trunk/lib/python/Products/PageTemplates/TALES.py
===================================================================
--- Zope/trunk/lib/python/Products/PageTemplates/TALES.py	2006-04-21 17:38:53 UTC (rev 67239)
+++ Zope/trunk/lib/python/Products/PageTemplates/TALES.py	2006-04-21 17:46:24 UTC (rev 67240)
@@ -259,6 +259,9 @@
             context=context,
             default=default,
             target_language=target_language)
+    
+    def getValue(self, name, default=None):
+        return self.vars.get(name, default)
 
 class TALESTracebackSupplement:
     """Implementation of ITracebackSupplement"""

Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===================================================================
--- Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py	2006-04-21 17:38:53 UTC (rev 67239)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py	2006-04-21 17:46:24 UTC (rev 67240)
@@ -71,7 +71,7 @@
     This is in the slot
   </p>
 </metal:block>
-<tal:block condition="default">
+<tal:block condition="nothing">
 <div metal:define-macro="themacro">
   <h1>This is the header</h1>
   <p metal:define-slot="theslot">
@@ -80,14 +80,12 @@
 </div>
 </tal:block>
 """
-        self.result = """
-<div>
+        self.result = """<div>
   <h1>This is the header</h1>
   <p>
     This is in the slot
   </p>
 </div>
-
 """       
 
     def testMacroExpansion(self):



More information about the Checkins mailing list