fix __init__ parameters
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 17 Aug 2009 20:02:57 +0200
changeset 2890 fdcb8a2bb6eb
parent 2889 5b42222d3b88
child 2891 60afb9705035
fix __init__ parameters
view.py
web/action.py
web/component.py
web/controller.py
web/facet.py
web/form.py
web/views/editforms.py
web/views/formrenderers.py
web/views/forms.py
web/views/magicsearch.py
web/views/urlpublishing.py
--- a/view.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/view.py	Mon Aug 17 20:02:57 2009 +0200
@@ -357,7 +357,7 @@
     default_rql = None
 
     def __init__(self, req, rset=None, **kwargs):
-        super(EntityStartupView, self).__init__(req, rset, **kwargs)
+        super(EntityStartupView, self).__init__(req, rset=rset, **kwargs)
         if rset is None:
             # this instance is not in the "entityview" category
             self.category = 'startupview'
--- a/web/action.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/web/action.py	Mon Aug 17 20:02:57 2009 +0200
@@ -53,7 +53,7 @@
     id = None
 
     def __init__(self, req, rset, title, path, **kwargs):
-        Action.__init__(self, req, rset)
+        Action.__init__(self, req, rset=rset)
         self.title = req._(title)
         self._path = path
         self.__dict__.update(kwargs)
--- a/web/component.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/web/component.py	Mon Aug 17 20:02:57 2009 +0200
@@ -75,7 +75,7 @@
     no_previous_page_link = no_next_page_link = u''
 
     def __init__(self, req, rset, **kwargs):
-        super(NavigationComponent, self).__init__(req, rset, **kwargs)
+        super(NavigationComponent, self).__init__(req, rset=rset, **kwargs)
         self.starting_from = 0
         self.total = rset.rowcount
 
--- a/web/controller.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/web/controller.py	Mon Aug 17 20:02:57 2009 +0200
@@ -87,15 +87,15 @@
     def process_rql(self, rql):
         """execute rql if specified"""
         # XXX assigning to self really necessary?
-        self.rset = None
+        self.cw_rset = None
         if rql:
             self.req.ensure_ro_rql(rql)
             if not isinstance(rql, unicode):
                 rql = unicode(rql, self.req.encoding)
             pp = self.vreg['components'].select_or_none('magicsearch', self.req)
             if pp is not None:
-                self.rset = pp.process_query(rql, self.req)
-        return self.rset
+                self.cw_rset = pp.process_query(rql, self.req)
+        return self.cw_rset
 
     def check_expected_params(self, params):
         """check that the given list of parameters are specified in the form
--- a/web/facet.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/web/facet.py	Mon Aug 17 20:02:57 2009 +0200
@@ -261,7 +261,7 @@
 
     def __init__(self, req, rset=None, rqlst=None, filtered_variable=None,
                  **kwargs):
-        super(AbstractFacet, self).__init__(req, rset, **kwargs)
+        super(AbstractFacet, self).__init__(req, rset=rset, **kwargs)
         assert rset is not None or rqlst is not None
         assert filtered_variable
         # facet retreived using `object_by_id` from an ajax call
--- a/web/form.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/web/form.py	Mon Aug 17 20:02:57 2009 +0200
@@ -47,7 +47,7 @@
         return '%s#%s' % (self.req.url(), self.domid)
 
     def __init__(self, req, rset, **kwargs):
-        super(FormMixIn, self).__init__(req, rset, **kwargs)
+        super(FormMixIn, self).__init__(req, rset=rset, **kwargs)
         self.restore_previous_post(self.session_key())
 
     def restore_previous_post(self, sessionkey):
--- a/web/views/editforms.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/web/views/editforms.py	Mon Aug 17 20:02:57 2009 +0200
@@ -412,7 +412,7 @@
 
     def __init__(self, req, rset, **kwargs):
         kwargs.setdefault('__redirectrql', rset.printable_rql())
-        super(TableEditForm, self).__init__(req, rset, **kwargs)
+        super(TableEditForm, self).__init__(req, rset=rset, **kwargs)
         for row in xrange(len(self.rset)):
             form = self.vreg['forms'].select('edition', self.req,
                                              rset=self.rset, row=row,
--- a/web/views/formrenderers.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/web/views/formrenderers.py	Mon Aug 17 20:02:57 2009 +0200
@@ -53,7 +53,7 @@
     button_bar_class = u'formButtonBar'
 
     def __init__(self, req=None, rset=None, row=None, col=None, **kwargs):
-        super(FormRenderer, self).__init__(req, rset, row, col)
+        super(FormRenderer, self).__init__(req, rset=rset, row=row, col=col)
         if self._set_options(kwargs):
             raise ValueError('unconsumed arguments %s' % kwargs)
 
--- a/web/views/forms.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/web/views/forms.py	Mon Aug 17 20:02:57 2009 +0200
@@ -77,7 +77,7 @@
     def __init__(self, req, rset=None, row=None, col=None,
                  submitmsg=None, mainform=True,
                  **kwargs):
-        super(FieldsForm, self).__init__(req, rset, row=row, col=col)
+        super(FieldsForm, self).__init__(req, rset=rset, row=row, col=col)
         self.fields = list(self.__class__._fields_)
         for key, val in kwargs.items():
             if key in NAV_FORM_PARAMETERS:
--- a/web/views/magicsearch.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/web/views/magicsearch.py	Mon Aug 17 20:02:57 2009 +0200
@@ -345,7 +345,7 @@
 class MagicSearchComponent(Component):
     id  = 'magicsearch'
     def __init__(self, req, rset=None):
-        super(MagicSearchComponent, self).__init__(req, rset)
+        super(MagicSearchComponent, self).__init__(req, rset=rset)
         processors = []
         self.by_name = {}
         for processorcls in self.vreg['components']['magicsearch_processor']:
--- a/web/views/urlpublishing.py	Mon Aug 17 20:02:25 2009 +0200
+++ b/web/views/urlpublishing.py	Mon Aug 17 20:02:57 2009 +0200
@@ -199,7 +199,7 @@
         evaluators = sorted(self.vreg['urlrewriting'].all_objects(),
                             key=lambda x: x.priority, reverse=True)
         for rewritercls in evaluators:
-            rewriter = rewritercls()
+            rewriter = rewritercls(req)
             try:
                 # XXX we might want to chain url rewrites
                 return rewriter.rewrite(req, uri)