[components] add **kwargs to render method of header components to make them usable as regular components (eg in other places than the header stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 24 Mar 2011 13:20:33 +0100
branchstable
changeset 7101 de388d0b727e
parent 7100 0f02ad198c1b
child 7102 0b7966f7bbcd
[components] add **kwargs to render method of header components to make them usable as regular components (eg in other places than the header
web/views/basecomponents.py
web/views/ibreadcrumbs.py
--- a/web/views/basecomponents.py	Wed Mar 23 18:20:34 2011 +0100
+++ b/web/views/basecomponents.py	Thu Mar 24 13:20:33 2011 +0100
@@ -1,4 +1,4 @@
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -99,7 +99,9 @@
     """display the instance name"""
     __regid__ = 'appliname'
 
-    def render(self, w):
+    # XXX support kwargs for compat with other components which gets the view as
+    # argument
+    def render(self, w, **kwargs):
         title = self._cw.property_value('ui.site-title')
         if title:
             w(u'<span id="appliName"><a href="%s">%s</a></span>' % (
--- a/web/views/ibreadcrumbs.py	Wed Mar 23 18:20:34 2011 +0100
+++ b/web/views/ibreadcrumbs.py	Thu Mar 24 13:20:33 2011 +0100
@@ -1,4 +1,4 @@
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -117,7 +117,9 @@
     link_template = u'<a href="%s">%s</a>'
     first_separator = True
 
-    def render(self, w):
+    # XXX support kwargs for compat with other components which gets the view as
+    # argument
+    def render(self, w, **kwargs):
         entity = self.cw_rset.get_entity(0, 0)
         adapter = ibreadcrumb_adapter(entity)
         view = self.cw_extra_kwargs.get('view')
@@ -178,7 +180,9 @@
 class BreadCrumbAnyRSetVComponent(BreadCrumbEntityVComponent):
     __select__ = basecomponents.HeaderComponent.__select__ & any_rset()
 
-    def render(self, w):
+    # XXX support kwargs for compat with other components which gets the view as
+    # argument
+    def render(self, w, **kwargs):
         w(u'<span id="breadcrumbs" class="pathbar">')
         if self.first_separator:
             w(self.separator)