# HG changeset patch # User Sylvain Thénault # Date 1300969233 -3600 # Node ID de388d0b727ecf338ca764c2485311abfef251d8 # Parent 0f02ad198c1bea58ecad1c51840f2ff40e79b70e [components] add **kwargs to render method of header components to make them usable as regular components (eg in other places than the header diff -r 0f02ad198c1b -r de388d0b727e web/views/basecomponents.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'%s' % ( diff -r 0f02ad198c1b -r de388d0b727e web/views/ibreadcrumbs.py --- 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'%s' 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'') if self.first_separator: w(self.separator)