[Checkins] SVN: five.pt/trunk/ Fixed a calling convention oddity.

Malthe Borch mborch at gmail.com
Tue Jan 5 11:32:24 EST 2010


Log message for revision 107710:
  Fixed a calling convention oddity.

Changed:
  U   five.pt/trunk/CHANGES.txt
  U   five.pt/trunk/src/five/pt/patches.py

-=-
Modified: five.pt/trunk/CHANGES.txt
===================================================================
--- five.pt/trunk/CHANGES.txt	2010-01-05 15:50:46 UTC (rev 107709)
+++ five.pt/trunk/CHANGES.txt	2010-01-05 16:32:23 UTC (rev 107710)
@@ -1,6 +1,11 @@
 Changelog
 =========
 
+In next release...
+
+- Fixed some calling convention oddity that would result in the view
+  instance being passed doubly as the template arguments.
+
 0.7 - 2009-05-20
 ~~~~~~~~~~~~~~~~
 

Modified: five.pt/trunk/src/five/pt/patches.py
===================================================================
--- five.pt/trunk/src/five/pt/patches.py	2010-01-05 15:50:46 UTC (rev 107709)
+++ five.pt/trunk/src/five/pt/patches.py	2010-01-05 16:32:23 UTC (rev 107710)
@@ -14,7 +14,7 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile as \
      FiveViewPageTemplateFile
-     
+
 from five.pt.pagetemplate import ViewPageTemplateFile
 from five.pt.pagetemplate import BaseTemplateFile
 
@@ -26,7 +26,7 @@
 except ImportError:
     from zope.app.pagetemplate.viewpagetemplatefile import BoundPageTemplate
     import Acquisition
-    
+
     class BoundPageTemplate(BoundPageTemplate, Acquisition.Implicit):
         """Implementing Acquisition.interfaces.IAcquirer and
         IAcquisitionWrapper.
@@ -34,9 +34,9 @@
 
         __parent__ = property(lambda self: self.im_self)
 
-        def __call__(self, *args, **kw):
+        def __call__(self, im_self=None, *args, **kw):
             if self.im_self is None:
-                im_self, args = args[0], args[1:]
+                im_self = im_self
             else:
                 im_self = aq_base(self.im_self)
                 if IAcquirer.providedBy(im_self):
@@ -47,13 +47,13 @@
         """Implement Acquisition.interfaces.IAcquirer and
         IAcquisitionWrapper.
         """
-        
+
 _marker = object()
 
 def get_bound_template(self, instance, type):
     if instance is None:
         return self
-    
+
     template = getattr(self, '_template', _marker)
     if template is _marker:
         self._template = template = ViewPageTemplateFile(self.filename)



More information about the checkins mailing list