[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/pagetemplate/ Backport of:

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 12 11:50:30 EDT 2004


Log message for revision 27053:
  Backport of:
  
  ------------------------------------------------------------------------
  r26444 | srichter | 2004-07-13 11:01:30 -0400 (Tue, 13 Jul 2004) | 5 
  lines
  
  While I was working on functional tests, I found the scenario when this
  path is chosen, which is when you get the source (for editing for
  example) and macro expansion is turned on. It is perfectly fine to pass
  an empty dict at this point, since the template itself is not evaluated.
  
  ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r26445 | srichter | 2004-07-13 11:01:55 -0400 (Tue, 13 Jul 2004) | 2 
  lines
  
  Converted XXX to TODO.
  
  ------------------------------------------------------------------------
  
  


Changed:
  U   Zope3/branches/ZopeX3-3.0/src/zope/pagetemplate/pagetemplate.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/pagetemplate/tests/test_ptfile.py


-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/pagetemplate/pagetemplate.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/pagetemplate/pagetemplate.py	2004-08-12 15:45:44 UTC (rev 27052)
+++ Zope3/branches/ZopeX3-3.0/src/zope/pagetemplate/pagetemplate.py	2004-08-12 15:50:30 UTC (rev 27053)
@@ -158,8 +158,9 @@
             if not self.expand:
                 return self._text
             try:
-                # XXX not clear how this ever gets called, but the
-                # first arg to pt_render() needs to change if it ever does.
+                # This gets called, if macro expansion is turned on.
+                # Note that an empty dictionary is fine for the context at
+                # this point, since we are not evaluating the template. 
                 return self.pt_render({}, source=1)
             except:
                 return ('%s\n Macro expansion failed\n %s\n-->\n%s' %

Modified: Zope3/branches/ZopeX3-3.0/src/zope/pagetemplate/tests/test_ptfile.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/pagetemplate/tests/test_ptfile.py	2004-08-12 15:45:44 UTC (rev 27052)
+++ Zope3/branches/ZopeX3-3.0/src/zope/pagetemplate/tests/test_ptfile.py	2004-08-12 15:50:30 UTC (rev 27053)
@@ -111,7 +111,7 @@
             "<html><head><title>sample document</title></head></html>",
             "text/html")
 
-    # XXX This reflects a case that simply isn't handled by the
+    # TODO: This reflects a case that simply isn't handled by the
     # sniffer; there are many, but it gets it right more often than
     # before.
     def donttest_sniffer_xml_simple(self):



More information about the Zope3-Checkins mailing list