replace deprecated cubicweb.common.selectors by its new module path (cubicweb.selectors) tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Tue, 17 Feb 2009 21:29:58 +0100
branchtls-sprint
changeset 692 800592b8d39b
parent 691 35133d86970b
child 696 2a5a19185288
replace deprecated cubicweb.common.selectors by its new module path (cubicweb.selectors)
common/appobject.py
common/entity.py
common/mixins.py
goa/appobjects/components.py
goa/appobjects/dbmgmt.py
goa/goactl.py
selectors.py
server/hooksmanager.py
sobjects/notification.py
test/unittest_rset.py
web/controller.py
web/facet.py
web/form.py
web/views/actions.py
web/views/ajaxedit.py
web/views/basecomponents.py
web/views/basecontrollers.py
web/views/baseforms.py
web/views/bookmark.py
web/views/calendar.py
web/views/embedding.py
web/views/euser.py
web/views/facets.py
web/views/ibreadcrumbs.py
web/views/idownloadable.py
web/views/igeocodable.py
web/views/iprogress.py
web/views/navigation.py
web/views/old_calendar.py
web/views/tableview.py
web/views/tabs.py
web/views/timeline.py
web/views/timetable.py
web/views/treeview.py
web/views/wdoc.py
--- a/common/appobject.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/common/appobject.py	Tue Feb 17 21:29:58 2009 +0100
@@ -18,10 +18,10 @@
 
 from cubicweb import Unauthorized
 from cubicweb.vregistry import VObject
+from cubicweb.selectors import yes
 from cubicweb.common.utils import UStringIO
 from cubicweb.common.uilib import html_escape, ustrftime
 from cubicweb.common.registerers import yes_registerer, priority_registerer
-from cubicweb.common.selectors import yes
 
 
 
--- a/common/entity.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/common/entity.py	Tue Feb 17 21:29:58 2009 +0100
@@ -16,9 +16,9 @@
 from cubicweb import Unauthorized
 from cubicweb.vregistry import autoselectors
 from cubicweb.rset import ResultSet
+from cubicweb.selectors import yes
 from cubicweb.common.appobject import AppRsetObject
 from cubicweb.common.registerers import id_registerer
-from cubicweb.common.selectors import yes
 from cubicweb.common.uilib import printable_value, html_escape, soup2xhtml
 from cubicweb.common.mixins import MI_REL_TRIGGERS
 from cubicweb.common.mttransforms import ENGINE
--- a/common/mixins.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/common/mixins.py	Tue Feb 17 21:29:58 2009 +0100
@@ -9,7 +9,7 @@
 
 from logilab.common.decorators import cached
 
-from cubicweb.common.selectors import implement_interface
+from cubicweb.selectors import implements
 from cubicweb.interfaces import IWorkflowable, IEmailable, ITree
 
 
@@ -315,8 +315,7 @@
     """a recursive tree view"""
     id = 'tree'
     item_vid = 'treeitem'
-    __selectors__ = (implement_interface,)
-    accepts_interfaces = (ITree,)
+    __selectors__ = implements(ITree)
 
     def call(self, done=None, **kwargs):
         if done is None:
--- a/goa/appobjects/components.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/goa/appobjects/components.py	Tue Feb 17 21:29:58 2009 +0100
@@ -12,10 +12,9 @@
 from logilab.common.decorators import cached
 
 from cubicweb import typed_eid
+from cubicweb.selectors import one_line_rset, match_search_state, accept
 from cubicweb.schema import display_name
 from cubicweb.common.view import StartupView, EntityView
-from cubicweb.common.selectors import (one_line_rset, match_search_state,
-                                    accept)
 from cubicweb.web import Redirect
 from cubicweb.web.views import vid_from_rset
 from cubicweb.goa.db import rset_from_objs
@@ -31,9 +30,7 @@
     """
     id = 'search-associate'
     
-    __selectors__ = (one_line_rset, match_search_state, accept)
-    accepts = ('Any',)
-    search_states = ('linksearch',)
+    __selectors__ = (one_line_rset, match_search_state('linksearch'), accept)
 
     def cell_call(self, row, col):
         entity = self.entity(0, 0)
--- a/goa/appobjects/dbmgmt.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/goa/appobjects/dbmgmt.py	Tue Feb 17 21:29:58 2009 +0100
@@ -13,7 +13,7 @@
 from logilab.common.decorators import cached
 from logilab.mtconverter import html_escape
 
-from cubicweb.common.selectors import none_rset, match_user_groups
+from cubicweb.selectors import none_rset, match_user_groups
 from cubicweb.common.view import StartupView
 from cubicweb.web import Redirect
 from cubicweb.goa.dbinit import fix_entities, init_persistent_schema, insert_versions
--- a/goa/goactl.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/goa/goactl.py	Tue Feb 17 21:29:58 2009 +0100
@@ -11,7 +11,7 @@
 from cubicweb import BadCommandUsage
 from cubicweb import CW_SOFTWARE_ROOT
 from cubicweb.toolsutils import (Command, register_commands, copy_skeleton,
-                              create_dir, create_symlink, create_copy)
+                                 create_dir, create_symlink, create_copy)
 from cubicweb.cwconfig import CubicWebConfiguration
 
 from logilab import common as lgc
@@ -54,6 +54,7 @@
     'rset.py',
     'schema.py',
     'schemaviewer.py',
+    'selectors.py',
     'vregistry.py',
     
     'common/appobject.py',
@@ -65,7 +66,6 @@
     'common/mttransforms.py',
     'common/registerers.py',
     'common/rest.py',
-    'common/selectors.py',
     'common/view.py',
     'common/uilib.py',
     'common/utils.py',
--- a/selectors.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/selectors.py	Tue Feb 17 21:29:58 2009 +0100
@@ -20,18 +20,17 @@
 above by::
 
     # in Python2.5
-    from cubicweb.common.selectors import traced_selection
+    from cubicweb.selectors import traced_selection
     with traced_selection():
         self.view('calendar', myrset)
 
     # in Python2.4
-    from cubicweb.common import selectors
+    from cubicweb import selectors
     selectors.TRACED_OIDS = ('calendar',)
     self.view('calendar', myrset)
     selectors.TRACED_OIDS = ()
  
 
-
 :organization: Logilab
 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
@@ -483,16 +482,12 @@
         self.expected_ifaces = expected_ifaces
 
     def score_class(self, eclass, req):
-        print '***********************************'
         score = 0
         for iface in self.expected_ifaces:
-            print 'TESTING', iface, 'on', eclass
             if isinstance(iface, basestring):
                 # entity type
                 iface = eclass.vreg.etype_class(iface)
-                print 'found iface ===', iface
             if implements_iface(eclass, iface):
-                print 'and implementing !!!'
                 score += 1
                 if getattr(iface, '__registry__', None) == 'etypes':
                     score += 1
@@ -508,7 +503,6 @@
                                 score += index
 #                                print 'etype majoration', index
                                 break
-        print '***********************************', score
         return score
 
 
--- a/server/hooksmanager.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/server/hooksmanager.py	Tue Feb 17 21:29:58 2009 +0100
@@ -181,9 +181,9 @@
 #         self.register_hook(tidy_html_fields('before_update_entity'), 'before_update_entity', '')
             
 from cubicweb.vregistry import autoselectors
+from cubicweb.selectors import yes
 from cubicweb.common.appobject import AppObject
 from cubicweb.common.registerers import yes_registerer
-from cubicweb.common.selectors import yes
 
 class autoid(autoselectors):
     """metaclass to create an unique 'id' attribute on the class using it"""
--- a/sobjects/notification.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/sobjects/notification.py	Tue Feb 17 21:29:58 2009 +0100
@@ -18,9 +18,9 @@
 from logilab.common.textutils import normalize_text
 
 from cubicweb import RegistryException
+from cubicweb.selectors import implements
 from cubicweb.common.view import EntityView, Component
 from cubicweb.common.registerers import accepts_registerer
-from cubicweb.common.selectors import implements
 from cubicweb.common.mail import format_mail
 
 from cubicweb.server.pool import PreCommitOperation
--- a/test/unittest_rset.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/test/unittest_rset.py	Tue Feb 17 21:29:58 2009 +0100
@@ -5,7 +5,7 @@
 from logilab.common.testlib import TestCase, unittest_main
 
 from cubicweb.devtools.apptest import EnvBasedTC
-from cubicweb.common.selectors import traced_selection
+from cubicweb.selectors import traced_selection
 
 from urlparse import urlsplit
 from rql import parse
--- a/web/controller.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/controller.py	Tue Feb 17 21:29:58 2009 +0100
@@ -11,7 +11,7 @@
 
 from cubicweb import typed_eid
 from cubicweb.common.registerers import priority_registerer
-from cubicweb.common.selectors import yes, require_group_compat
+from cubicweb.selectors import yes, require_group_compat
 from cubicweb.common.appobject import AppObject
 from cubicweb.web import LOGGER, Redirect, RequestError
 
--- a/web/facet.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/facet.py	Tue Feb 17 21:29:58 2009 +0100
@@ -19,7 +19,7 @@
 from rql import parse, nodes
 
 from cubicweb import Unauthorized, typed_eid
-from cubicweb.common.selectors import match_context_prop, one_has_relation
+from cubicweb.selectors import match_context_prop, one_has_relation
 from cubicweb.common.registerers import priority_registerer
 from cubicweb.common.appobject import AppRsetObject
 from cubicweb.common.utils import AcceptMixIn
--- a/web/form.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/form.py	Tue Feb 17 21:29:58 2009 +0100
@@ -11,7 +11,7 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb import typed_eid
-from cubicweb.common.selectors import match_form_params
+from cubicweb.selectors import match_form_params
 from cubicweb.common.registerers import accepts_registerer
 from cubicweb.common.view import NOINDEX, NOFOLLOW, View, EntityView, AnyRsetView
 from cubicweb.web import stdmsgs
--- a/web/views/actions.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/actions.py	Tue Feb 17 21:29:58 2009 +0100
@@ -6,7 +6,7 @@
 """
 __docformat__ = "restructuredtext en"
 
-from cubicweb.common.selectors import (
+from cubicweb.selectors import (
     yes, one_line_rset, two_lines_rset, one_etype_rset, relation_possible,
     non_final_entity,
     authenticated_user, match_user_groups, match_search_state,
--- a/web/views/ajaxedit.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/ajaxedit.py	Tue Feb 17 21:29:58 2009 +0100
@@ -1,13 +1,12 @@
 """Set of views allowing edition of entities/relations using ajax
 
 :organization: Logilab
-:copyright: 2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
 
-from cubicweb.common.selectors import (chainfirst, match_form_params,
-                                    match_kwargs)
+from cubicweb.selectors import chainfirst, match_form_params, match_kwargs
 from cubicweb.web.box import EditRelationBoxTemplate
 
 class AddRelationView(EditRelationBoxTemplate):
--- a/web/views/basecomponents.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/basecomponents.py	Tue Feb 17 21:29:58 2009 +0100
@@ -13,11 +13,11 @@
 from rql import parse
 
 from cubicweb import Unauthorized
+from cubicweb.selectors import (yes, non_final_entity, one_line_rset,
+                                chainfirst, two_etypes_rset,
+                                match_form_params, relation_possible)
 from cubicweb.common.uilib import html_escape, toggle_action
-from cubicweb.common.selectors import yes, non_final_entity, one_line_rset
 from cubicweb.schema import display_name
-from cubicweb.common.selectors import (chainfirst, two_etypes_rset,
-                                       match_form_params, relation_possible)
 
 from cubicweb.web.htmlwidgets import MenuWidget, PopupBoxMenu, BoxSeparator, BoxLink
 from cubicweb.web.component import (Component, EntityVComponent, 
--- a/web/views/basecontrollers.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/basecontrollers.py	Tue Feb 17 21:29:58 2009 +0100
@@ -18,8 +18,7 @@
 from logilab.common.decorators import cached
 
 from cubicweb import NoSelectableObject, ValidationError, typed_eid
-from cubicweb.selectors import match_user_groups
-from cubicweb.common.selectors import yes
+from cubicweb.selectors import yes, match_user_groups
 from cubicweb.common.mail import format_mail
 from cubicweb.common.view import STRICT_DOCTYPE, CW_XHTML_EXTENSIONS
 from cubicweb.web import ExplicitLogin, Redirect, RemoteCallFailed
--- a/web/views/baseforms.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/baseforms.py	Tue Feb 17 21:29:58 2009 +0100
@@ -15,11 +15,11 @@
 from logilab.common.decorators import cached
 
 from cubicweb.interfaces import IWorkflowable
+from cubicweb.selectors import (specified_etype_implements,
+                                match_kwargs, match_form_params, 
+                                one_line_rset, implements)
 from cubicweb.common.utils import make_uid
 from cubicweb.common.uilib import cut
-from cubicweb.common.selectors import (specified_etype_implements,
-                                       match_kwargs, match_form_params, 
-                                       one_line_rset, implements)
 from cubicweb.common.view import EntityView
 from cubicweb.web import INTERNAL_FIELD_VALUE, stdmsgs, eid_param
 from cubicweb.web.controller import NAV_FORM_PARAMETERS
--- a/web/views/bookmark.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/bookmark.py	Tue Feb 17 21:29:58 2009 +0100
@@ -9,7 +9,7 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb import Unauthorized
-from cubicweb.common.selectors import implements
+from cubicweb.selectors import implements
 from cubicweb.web.htmlwidgets import BoxWidget, BoxMenu, RawBoxItem
 from cubicweb.web.action import Action
 from cubicweb.web.box import UserRQLBoxTemplate
--- a/web/views/calendar.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/calendar.py	Tue Feb 17 21:29:58 2009 +0100
@@ -1,7 +1,7 @@
 """html calendar views
 
 :organization: Logilab
-:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 
@@ -13,9 +13,9 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb.interfaces import ICalendarable
+from cubicweb.selectors import implements
 from cubicweb.common.utils import date_range
 from cubicweb.common.uilib import ajax_replace_url
-from cubicweb.common.selectors import implement_interface
 from cubicweb.common.registerers import priority_registerer
 from cubicweb.common.view import EntityView
 
@@ -83,8 +83,7 @@
     Does apply to ICalendarable compatible entities
     """
     __registerer__ = priority_registerer
-    __selectors__ = (implement_interface,)
-    accepts_interfaces = (ICalendarable,)
+    __selectors__ = implements(ICalendarable)
     need_navigation = False
     content_type = 'text/calendar'
     title = _('iCalendar')
@@ -114,8 +113,7 @@
     Does apply to ICalendarable compatible entities
     """
     __registerer__ = priority_registerer
-    __selectors__ = (implement_interface,)
-    accepts_interfaces = (ICalendarable,)
+    __selectors__ = implements(ICalendarable)
     need_navigation = False
     title = _('hCalendar')
     #templatable = False
@@ -146,8 +144,7 @@
 class OneMonthCal(EntityView):
     """At some point, this view will probably replace ampm calendars"""
     __registerer__ = priority_registerer
-    __selectors__ = (implement_interface, )
-    accepts_interfaces = (ICalendarable,)
+    __selectors__ = implements(ICalendarable)
     need_navigation = False
     id = 'onemonthcal'
     title = _('one month')
@@ -331,8 +328,7 @@
 class OneWeekCal(EntityView):
     """At some point, this view will probably replace ampm calendars"""
     __registerer__ = priority_registerer
-    __selectors__ = (implement_interface, )
-    accepts_interfaces = (ICalendarable,)
+    __selectors__ = implements(ICalendarable)
     need_navigation = False
     id = 'oneweekcal'
     title = _('one week')
--- a/web/views/embedding.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/embedding.py	Tue Feb 17 21:29:58 2009 +0100
@@ -15,10 +15,10 @@
 from logilab.mtconverter import guess_encoding
 
 from cubicweb import urlquote # XXX should use view.url_quote method
+from cubicweb.selectors import (one_line_rset, score_entity,
+                                match_search_state, implements)
 from cubicweb.interfaces import IEmbedable
 from cubicweb.common.uilib import soup2xhtml
-from cubicweb.common.selectors import (one_line_rset, score_entity,
-                                       match_search_state, implements)
 from cubicweb.common.view import NOINDEX, NOFOLLOW
 from cubicweb.web.controller import Controller
 from cubicweb.web.action import Action
--- a/web/views/euser.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/euser.py	Tue Feb 17 21:29:58 2009 +0100
@@ -10,7 +10,7 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb.schema import display_name
-from cubicweb.common.selectors import one_line_rset, implements, match_user_groups
+from cubicweb.selectors import one_line_rset, implements, match_user_groups
 from cubicweb.web import INTERNAL_FIELD_VALUE
 from cubicweb.web.form import EntityForm
 from cubicweb.web.action import Action
--- a/web/views/facets.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/facets.py	Tue Feb 17 21:29:58 2009 +0100
@@ -10,9 +10,9 @@
 
 from logilab.mtconverter import html_escape
 
-from cubicweb.common.selectors import (chainfirst, chainall, non_final_entity,
-                                    two_lines_rset, match_context_prop,
-                                    yes, one_has_relation)
+from cubicweb.selectors import (chainfirst, chainall, non_final_entity,
+                                two_lines_rset, match_context_prop,
+                                yes, one_has_relation)
 from cubicweb.web.box import BoxTemplate
 from cubicweb.web.facet import (AbstractFacet, VocabularyFacet, FacetStringWidget,
                              RelationFacet, prepare_facets_rqlst, filter_hiddens)
--- a/web/views/ibreadcrumbs.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/ibreadcrumbs.py	Tue Feb 17 21:29:58 2009 +0100
@@ -1,7 +1,7 @@
 """navigation components definition for CubicWeb web client
 
 :organization: Logilab
-:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
@@ -9,8 +9,7 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb.interfaces import IBreadCrumbs
-from cubicweb.common.selectors import (match_context_prop, one_line_rset, 
-                                    implement_interface)
+from cubicweb.selectors import match_context_prop, one_line_rset, implements
 from cubicweb.common.view import EntityView
 from cubicweb.common.uilib import cut
 # don't use AnyEntity since this may cause bug with isinstance() due to reloading
@@ -29,8 +28,7 @@
     # register msg not generated since no entity implements IPrevNext in cubicweb itself
     title = _('contentnavigation_breadcrumbs')
     help = _('contentnavigation_breadcrumbs_description')
-    __selectors__ = (one_line_rset, match_context_prop, implement_interface)
-    accepts_interfaces = (IBreadCrumbs,)
+    __selectors__ = (one_line_rset, match_context_prop, implements(IBreadCrumbs))
     context = 'navtop'
     order = 5
     visible = False
--- a/web/views/idownloadable.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/idownloadable.py	Tue Feb 17 21:29:58 2009 +0100
@@ -8,10 +8,10 @@
 
 from logilab.mtconverter import BINARY_ENCODINGS, TransformError, html_escape
 
+from cubicweb.selectors import (one_line_rset, score_entity,
+                                implements, match_context_prop)
 from cubicweb.interfaces import IDownloadable
 from cubicweb.common.mttransforms import ENGINE
-from cubicweb.common.selectors import (one_line_rset, score_entity,
-                                       implements, match_context_prop)
 from cubicweb.web.box import EntityBoxTemplate
 from cubicweb.web.views import baseviews
 
--- a/web/views/igeocodable.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/igeocodable.py	Tue Feb 17 21:29:58 2009 +0100
@@ -1,10 +1,16 @@
-# -*- coding: utf-8 -*-
+"""Specific views for entities implementing IGeocodable
+
+:organization: Logilab
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
+"""
+__docformat__ = "restructuredtext en"
 
 import simplejson
 
 from cubicweb.interfaces import IGeocodable
 from cubicweb.common.view import EntityView
-from cubicweb.common.selectors import implement_interface
+from cubicweb.selectors import implements
 
 class GeocodingJsonView(EntityView):
     id = 'geocoding-json'
@@ -12,8 +18,7 @@
     templatable = False
     content_type = 'application/json'
 
-    __selectors__ = (implement_interface,)
-    accepts_interfaces = (IGeocodable,)
+    __selectors__ = implements(IGeocodable)
 
     def call(self):
         zoomlevel = self.req.form.pop('zoomlevel', 8)
@@ -46,8 +51,7 @@
 class GoogleMapBubbleView(EntityView):
     id = 'gmap-bubble'
 
-    __selectors__ = (implement_interface,)
-    accepts_interfaces = (IGeocodable,)
+    __selectors__ = implements(IGeocodable)
 
     def cell_call(self, row, col):
         entity = self.entity(row, col)
@@ -58,8 +62,7 @@
 class GoogleMapsView(EntityView):
     id = 'gmap-view'
 
-    __selectors__ = (implement_interface,)
-    accepts_interfaces = (IGeocodable,)
+    __selectors__ = implements(IGeocodable)
     need_navigation = False
 
     def call(self, gmap_key, width=400, height=400, uselabel=True, urlparams=None):
--- a/web/views/iprogress.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/iprogress.py	Tue Feb 17 21:29:58 2009 +0100
@@ -1,7 +1,7 @@
 """Specific views for entities implementing IProgress
 
 :organization: Logilab
-:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 
@@ -9,10 +9,10 @@
 
 from logilab.mtconverter import html_escape
 
+from cubicweb.selectors import implements, accept
 from cubicweb.interfaces import IProgress, IMileStone
 from cubicweb.schema import display_name
 from cubicweb.common.view import EntityView
-from cubicweb.common.selectors import implement_interface, accept
 from cubicweb.web.htmlwidgets import ProgressBarWidget
 
 
@@ -35,9 +35,7 @@
     
     id = 'progress_table_view'
     title = _('task progression')
-    __selectors__ = (accept, implement_interface)
-
-    accepts_interfaces = (IMileStone,)
+    __selectors__ = implements(IMileStone)
 
     # default columns of the table
     columns = (_('project'), _('milestone'), _('state'), _('eta_date'),
@@ -182,9 +180,7 @@
     """displays a progress bar"""
     id = 'progressbar'
     title = _('progress bar')
-    __selectors__ = (accept, implement_interface)
-
-    accepts_interfaces = (IProgress,)
+    __selectors__ = implements(IProgress)
 
     def cell_call(self, row, col):
         self.req.add_css('cubicweb.iprogress.css')
--- a/web/views/navigation.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/navigation.py	Tue Feb 17 21:29:58 2009 +0100
@@ -1,7 +1,7 @@
 """navigation components definition for CubicWeb web client
 
 :organization: Logilab
-:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
@@ -11,9 +11,9 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb.interfaces import IPrevNext
-from cubicweb.common.selectors import (paginated_rset, sorted_rset,
-                                       primary_view, match_context_prop,
-                                       one_line_rset, implement_interface)
+from cubicweb.selectors import (paginated_rset, sorted_rset,
+                                primary_view, match_context_prop,
+                                one_line_rset, implements)
 from cubicweb.common.uilib import cut
 from cubicweb.web.component import EntityVComponent, NavigationComponent
 
@@ -181,8 +181,7 @@
     title = _('contentnavigation_prevnext')
     help = _('contentnavigation_prevnext_description')
     __selectors__ = (one_line_rset, primary_view,
-                     match_context_prop, implement_interface)
-    accepts_interfaces = (IPrevNext,)
+                     match_context_prop, implements(IPrevNext))
     context = 'navbottom'
     order = 10
     def call(self, view=None):
--- a/web/views/old_calendar.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/old_calendar.py	Tue Feb 17 21:29:58 2009 +0100
@@ -1,7 +1,7 @@
 """html calendar views
 
 :organization: Logilab
-:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 
@@ -11,7 +11,7 @@
 
 from cubicweb.interfaces import ICalendarViews
 from cubicweb.common.utils import date_range
-from cubicweb.common.selectors import implement_interface
+from cubicweb.selectors import implements
 from cubicweb.common.registerers import priority_registerer
 from cubicweb.common.view import EntityView
 
@@ -33,8 +33,7 @@
 class _CalendarView(EntityView):
     """base calendar view containing helpful methods to build calendar views"""
     __registerer__ = priority_registerer
-    __selectors__ = (implement_interface,)
-    accepts_interfaces = (ICalendarViews,)
+    __selectors__ = implements(ICalendarViews)
     need_navigation = False
 
     # Navigation building methods / views ####################################
--- a/web/views/tableview.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/tableview.py	Tue Feb 17 21:29:58 2009 +0100
@@ -13,11 +13,10 @@
 
 from logilab.mtconverter import html_escape
 
+from cubicweb.selectors import nonempty_rset, match_form_params, accept_rset
 from cubicweb.common.utils import make_uid
 from cubicweb.common.uilib import toggle_action, limitsize, jsonize, htmlescape
 from cubicweb.common.view import EntityView, AnyRsetView
-from cubicweb.common.selectors import (nonempty_rset,  match_form_params,
-                                    accept_rset)
 from cubicweb.web.htmlwidgets import (TableWidget, TableColumn, MenuWidget,
                                    PopupBoxMenu, BoxLink)
 from cubicweb.web.facet import prepare_facets_rqlst, filter_hiddens
--- a/web/views/tabs.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/tabs.py	Tue Feb 17 21:29:58 2009 +0100
@@ -1,7 +1,7 @@
 """base classes to handle tabbed views
 
 :organization: Logilab
-:copyright: 2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2008-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 
@@ -11,8 +11,8 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb import NoSelectableObject, role
+from cubicweb.selectors import has_related_entities
 from cubicweb.common.view import EntityView
-from cubicweb.common.selectors import has_related_entities
 from cubicweb.common.utils import HTMLHead
 from cubicweb.common.uilib import rql_for_eid
 
--- a/web/views/timeline.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/timeline.py	Tue Feb 17 21:29:58 2009 +0100
@@ -3,7 +3,7 @@
 cf. http://code.google.com/p/simile-widgets/
 
 :organization: Logilab
-:copyright: 2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2008-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
@@ -13,8 +13,8 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb.interfaces import ICalendarable
+from cubicweb.selectors import implements
 from cubicweb.common.view import EntityView, StartupView
-from cubicweb.common.selectors import implement_interface
 
 
 # 
@@ -28,8 +28,7 @@
     templatable = False
     content_type = 'application/json'
 
-    __selectors__ = (implement_interface,)
-    accepts_interfaces = (ICalendarable,)
+    __selectors__ = implements(ICalendarable)
     date_fmt = '%Y/%m/%d'
     
     def call(self):
@@ -103,8 +102,7 @@
 class TimelineView(TimelineViewMixIn, EntityView):
     """builds a cubicweb timeline widget node"""
     id = 'timeline'
-    __selectors__ = (implement_interface,)
-    accepts_interfaces = (ICalendarable,)
+    __selectors__ = implements(ICalendarable)
     need_navigation = False
     def call(self, tlunit=None):
         self.req.html_headers.define_var('Timeline_urlPrefix', self.req.datadir_url)
--- a/web/views/timetable.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/timetable.py	Tue Feb 17 21:29:58 2009 +0100
@@ -1,15 +1,15 @@
 """html calendar views
 
 :organization: Logilab
-:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 
 from logilab.mtconverter import html_escape
 
 from cubicweb.interfaces import ITimetableViews
+from cubicweb.selectors import implements
 from cubicweb.common.utils import date_range
-from cubicweb.common.selectors import implement_interface
 from cubicweb.common.view import AnyRsetView
 
 
@@ -25,8 +25,7 @@
 class TimeTableView(AnyRsetView):
     id = 'timetable'
     title = _('timetable')
-    __selectors__ = (implement_interface,)
-    accepts_interfaces = (ITimetableViews,)
+    __selectors__ = implements(ITimetableViews)
     need_navigation = False
 
     def call(self, title=None):
--- a/web/views/treeview.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/treeview.py	Tue Feb 17 21:29:58 2009 +0100
@@ -1,11 +1,9 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb.interfaces import ITree
-from cubicweb.common.selectors import implement_interface, yes
+from cubicweb.selectors import implements
 from cubicweb.common.view import EntityView
 
-from cubicweb.web.views.baseviews import OneLineView
-
 class TreeView(EntityView):
     id = 'treeview'
     itemvid = 'treeitemview'
--- a/web/views/wdoc.py	Tue Feb 17 20:56:45 2009 +0100
+++ b/web/views/wdoc.py	Tue Feb 17 21:29:58 2009 +0100
@@ -15,7 +15,7 @@
 from logilab.common.changelog import ChangeLog
 from logilab.mtconverter import CHARSET_DECL_RGX
 
-from cubicweb.common.selectors import match_form_params
+from cubicweb.selectors import match_form_params
 from cubicweb.common.view import StartupView
 from cubicweb.common.uilib import rest_publish
 from cubicweb.web import NotFound
@@ -85,8 +85,7 @@
 # help views ##################################################################
 
 class InlineHelpView(StartupView):
-    __selectors__ = (match_form_params,)
-    form_params = ('fid',)
+    __selectors__ = match_form_params('fid')
     id = 'wdoc'
     title = _('site documentation')
     
@@ -163,9 +162,8 @@
 
 
 class InlineHelpImageView(StartupView):
-    __selectors__ = (match_form_params,)
-    form_params = ('fid',)
     id = 'wdocimages'
+    __selectors__ = match_form_params('fid')
     binary = True
     templatable = False
     content_type = 'image/png'