# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1232022453 -3600 # Node ID 18b4dd650ef8815757234b0f0c6fa67f6b85f8a4 # Parent 6fbc0ab79a2d80cedcd269b92d4fe6c1f56d1693 massive selector update diff -r 6fbc0ab79a2d -r 18b4dd650ef8 common/selectors.py --- a/common/selectors.py Thu Jan 15 13:27:17 2009 +0100 +++ b/common/selectors.py Thu Jan 15 13:27:33 2009 +0100 @@ -50,7 +50,6 @@ from cubicweb.cwconfig import CubicWebConfiguration from cubicweb.schema import split_expression - # helpers for debugging selectors SELECTOR_LOGGER = logging.getLogger('cubicweb.selectors') TRACED_OIDS = () @@ -223,7 +222,7 @@ @lltrace def authenticated_user(cls, req, *args, **kwargs): """accept if user is authenticated""" - return not anonymous_selector(cls, req, *args, **kwargs) + return not anonymous_user(cls, req, *args, **kwargs) not_anonymous_selector = deprecated_function(authenticated_user) @lltrace diff -r 6fbc0ab79a2d -r 18b4dd650ef8 goa/appobjects/components.py --- a/goa/appobjects/components.py Thu Jan 15 13:27:17 2009 +0100 +++ b/goa/appobjects/components.py Thu Jan 15 13:27:33 2009 +0100 @@ -15,7 +15,7 @@ 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_selector) + accept) from cubicweb.web import Redirect from cubicweb.web.views import vid_from_rset from cubicweb.goa.db import rset_from_objs @@ -31,7 +31,7 @@ """ id = 'search-associate' - __selectors__ = (one_line_rset, match_search_state, accept_selector) + __selectors__ = (one_line_rset, match_search_state, accept) accepts = ('Any',) search_states = ('linksearch',) diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/box.py --- a/web/box.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/box.py Thu Jan 15 13:27:33 2009 +0100 @@ -14,8 +14,8 @@ accepts_registerer, extresources_registerer, etype_rtype_priority_registerer) from cubicweb.common.selectors import ( - etype_rtype_selector, one_line_rset, accept_selector, accept_rtype_selector, - primaryview_selector, contextprop_selector, has_related_entities, + etype_rtype_selector, one_line_rset, accept, accept_rtype_selector, + primary_view, match_context_prop, has_related_entities, _rqlcondition_selector) from cubicweb.common.view import Template from cubicweb.common.appobject import ReloadableMixIn @@ -42,7 +42,7 @@ box.render(self.w) """ __registry__ = 'boxes' - __selectors__ = Template.__selectors__ + (contextprop_selector,) + __selectors__ = Template.__selectors__ + (match_context_prop,) categories_in_order = () property_defs = { @@ -150,9 +150,9 @@ class EntityBoxTemplate(BoxTemplate): """base class for boxes related to a single entity""" __registerer__ = accepts_registerer - __selectors__ = (one_line_rset, primaryview_selector, - contextprop_selector, etype_rtype_selector, - accept_rtype_selector, accept_selector, + __selectors__ = (one_line_rset, primary_view, + match_context_prop, etype_rtype_selector, + accept_rtype_selector, accept, _rqlcondition_selector) accepts = ('Any',) context = 'incontext' diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/controller.py --- a/web/controller.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/controller.py Thu Jan 15 13:27:33 2009 +0100 @@ -11,7 +11,7 @@ from cubicweb import typed_eid from cubicweb.common.registerers import priority_registerer -from cubicweb.common.selectors import in_group_selector +from cubicweb.common.selectors import match_user_group from cubicweb.common.appobject import AppObject from cubicweb.web import LOGGER, Redirect, RequestError @@ -68,7 +68,7 @@ """ __registry__ = 'controllers' __registerer__ = priority_registerer - __selectors__ = (in_group_selector,) + __selectors__ = (match_user_group,) require_groups = () def __init__(self, *args, **kwargs): diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/form.py --- a/web/form.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/form.py Thu Jan 15 13:27:33 2009 +0100 @@ -11,7 +11,7 @@ from logilab.mtconverter import html_escape from cubicweb import typed_eid -from cubicweb.common.selectors import req_form_params_selector +from cubicweb.common.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 @@ -239,7 +239,7 @@ should list necessary parameters in the form to be accepted. """ __registerer__ = accepts_registerer - __select__ = classmethod(req_form_params_selector) + __select__ = classmethod(match_form_params) form_params = () diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/test/unittest_viewselector.py --- a/web/test/unittest_viewselector.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/test/unittest_viewselector.py Thu Jan 15 13:27:33 2009 +0100 @@ -10,7 +10,7 @@ from cubicweb import CW_SOFTWARE_ROOT as BASE, Binary -from cubicweb.common.selectors import in_group_selector +from cubicweb.common.selectors import match_user_group from cubicweb.web._exceptions import NoSelectableObject from cubicweb.web.action import Action @@ -387,12 +387,12 @@ - def test_owners_in_group_selector(self): - """tests usage of 'owners' group with in_group_selector""" + def test_owners_match_user_group(self): + """tests usage of 'owners' group with match_user_group""" class SomeAction(Action): id = 'yo' category = 'foo' - __selectors__ = (in_group_selector,) + __selectors__ = (match_user_group,) require_groups = ('owners', ) self.vreg.register_vobject_class(SomeAction) self.failUnless(SomeAction in self.vreg['actions']['yo'], self.vreg['actions']) diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/actions.py --- a/web/views/actions.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/actions.py Thu Jan 15 13:27:33 2009 +0100 @@ -55,7 +55,7 @@ class ViewAction(Action): category = 'mainactions' - __selectors__ = (in_group_selector, searchstate_accept) + __selectors__ = (match_user_group, searchstate_accept) require_groups = ('users', 'managers') order = 0 @@ -110,7 +110,7 @@ class MultipleEditAction(EntityAction): category = 'mainactions' - __selectors__ = (two_lines_rset, oneetyperset_selector, + __selectors__ = (two_lines_rset, one_etype_rset, searchstate_accept) schema_action = 'update' order = 10 @@ -198,7 +198,7 @@ return 0 __selectors__ = (match_search_state, chainfirst(etype_rset_selector, - chainall(two_lines_rset, oneetyperset_selector, + chainall(two_lines_rset, one_etype_rset, has_add_perm_selector))) @property @@ -219,7 +219,7 @@ class UserPreferencesAction(Action): category = 'useractions' - __selectors__ = not_anonymous_selector, + __selectors__ = authenticated_user, order = 10 id = 'myprefs' @@ -231,7 +231,7 @@ class UserInfoAction(Action): category = 'useractions' - __selectors__ = not_anonymous_selector, + __selectors__ = authenticated_user, order = 20 id = 'myinfos' @@ -243,7 +243,7 @@ class LogoutAction(Action): category = 'useractions' - __selectors__ = not_anonymous_selector, + __selectors__ = authenticated_user, order = 30 id = 'logout' @@ -258,7 +258,7 @@ class ManagersAction(Action): category = 'siteactions' __abstract__ = True - __selectors__ = in_group_selector, + __selectors__ = match_user_group, require_groups = ('managers',) def url(self): @@ -301,7 +301,7 @@ return self.rset.get_entity(self.row or 0, self.col or 0).actual_url() class UserPreferencesEntityAction(EntityAction): - __selectors__ = EntityAction.__selectors__ + (one_line_rset, in_group_selector,) + __selectors__ = EntityAction.__selectors__ + (one_line_rset, match_user_group,) require_groups = ('owners', 'managers') category = 'mainactions' accepts = ('EUser',) diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/ajaxedit.py --- a/web/views/ajaxedit.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/ajaxedit.py Thu Jan 15 13:27:33 2009 +0100 @@ -6,8 +6,8 @@ """ __docformat__ = "restructuredtext en" -from cubicweb.common.selectors import (chainfirst, req_form_params_selector, - kwargs_selector) +from cubicweb.common.selectors import (chainfirst, match_form_params, + match_kwargs) from cubicweb.web.box import EditRelationBoxTemplate class AddRelationView(EditRelationBoxTemplate): @@ -18,7 +18,7 @@ class attributes. """ __registry__ = 'views' - __selectors__ = (chainfirst(req_form_params_selector, kwargs_selector),) + __selectors__ = (chainfirst(match_form_params, match_kwargs),) property_defs = {} # don't want to inherit this from Box id = 'xaddrelation' expected_kwargs = form_params = ('rtype', 'target') diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/basecomponents.py --- a/web/views/basecomponents.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/basecomponents.py Thu Jan 15 13:27:33 2009 +0100 @@ -14,10 +14,10 @@ from cubicweb import Unauthorized from cubicweb.common.uilib import html_escape, toggle_action -from cubicweb.common.selectors import yes, nfentity_selector, one_line_rset +from cubicweb.common.selectors import yes, non_final_entity, one_line_rset from cubicweb.schema import display_name -from cubicweb.common.selectors import (chainfirst, multitype_selector, - req_form_params_selector) +from cubicweb.common.selectors import (chainfirst, two_etypes_rset, + match_form_params) from cubicweb.web.htmlwidgets import MenuWidget, PopupBoxMenu, BoxSeparator, BoxLink from cubicweb.web.component import (VComponent, SingletonVComponent, EntityVComponent, @@ -191,7 +191,7 @@ to be able to filter accordingly. """ id = 'etypenavigation' - __select__ = classmethod(chainfirst(multitype_selector, req_form_params_selector)) + __select__ = classmethod(chainfirst(two_etypes_rset, match_form_params)) form_params = ('__restrtype', '__restrtypes', '__restrrql') visible = False # disabled by default @@ -238,14 +238,14 @@ class RSSFeedURL(VComponent): id = 'rss_feed_url' - __selectors__ = (nfentity_selector,) + __selectors__ = (non_final_entity,) def feed_url(self): return self.build_url(rql=self.limited_rql(), vid='rss') class RSSEntityFeedURL(VComponent): id = 'rss_feed_url' - __selectors__ = (nfentity_selector, one_line_rset) + __selectors__ = (non_final_entity, one_line_rset) def feed_url(self): return self.entity(0, 0).rss_feed_url() diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/baseforms.py --- a/web/views/baseforms.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/baseforms.py Thu Jan 15 13:27:33 2009 +0100 @@ -17,9 +17,9 @@ from cubicweb.interfaces import IWorkflowable from cubicweb.common.utils import make_uid from cubicweb.common.uilib import cut -from cubicweb.common.selectors import (etype_form_selector, kwargs_selector, - one_line_rset, interface_selector, - req_form_params_selector, accept_selector) +from cubicweb.common.selectors import (accept_etype, match_kwargs, + one_line_rset, implement_interface, + match_form_params, accept) from cubicweb.common.view import EntityView from cubicweb.web import INTERNAL_FIELD_VALUE, stdmsgs, eid_param from cubicweb.web.controller import NAV_FORM_PARAMETERS @@ -87,7 +87,7 @@ id = 'statuschange' title = _('status change') - __selectors__ = (interface_selector, req_form_params_selector) + __selectors__ = (implement_interface, match_form_params) accepts_interfaces = (IWorkflowable,) form_params = ('treid',) @@ -150,7 +150,7 @@ class ClickAndEditForm(EntityForm): id = 'reledit' - __selectors__ = (kwargs_selector, ) + __selectors__ = (match_kwargs, ) expected_kwargs = ('rtype',) #FIXME editableField class could be toggleable from userprefs @@ -216,7 +216,7 @@ dynamic default values such as the 'tomorrow' date or the user's login being connected """ - __selectors__ = (one_line_rset, accept_selector) + __selectors__ = (one_line_rset, accept) id = 'edition' title = _('edition') @@ -517,7 +517,7 @@ class CreationForm(EditionForm): - __selectors__ = (etype_form_selector, ) + __selectors__ = (accept_etype, ) id = 'creation' title = _('creation') @@ -630,7 +630,7 @@ class InlineEntityCreationForm(InlineFormMixIn, CreationForm): id = 'inline-creation' - __selectors__ = (kwargs_selector, etype_form_selector) + __selectors__ = (match_kwargs, accept_etype) expected_kwargs = ('ptype', 'peid', 'rtype') EDITION_BODY = u'''\ @@ -669,7 +669,7 @@ class InlineEntityEditionForm(InlineFormMixIn, EditionForm): id = 'inline-edition' - __selectors__ = (accept_selector, kwargs_selector) + __selectors__ = (accept, match_kwargs) expected_kwargs = ('ptype', 'peid', 'rtype') EDITION_BODY = u'''\ @@ -872,7 +872,7 @@ class UnrelatedDivs(EntityView): id = 'unrelateddivs' - __selectors__ = (req_form_params_selector,) + __selectors__ = (match_form_params,) form_params = ('relation',) @property diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/baseviews.py --- a/web/views/baseviews.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/baseviews.py Thu Jan 15 13:27:33 2009 +0100 @@ -21,9 +21,9 @@ from logilab.mtconverter import html_escape, TransformError from cubicweb import Unauthorized, NoSelectableObject, typed_eid -from cubicweb.common.selectors import (yes, nonempty_rset, accept_selector, +from cubicweb.common.selectors import (yes, nonempty_rset, accept, one_line_rset, match_search_state, - req_form_params_selector, accept_rset_selector) + match_form_params, accept_rset) from cubicweb.common.uilib import (cut, printable_value, UnicodeCSVWriter, ajax_replace_url, rql_for_eid) from cubicweb.common.view import EntityView, AnyRsetView, EmptyRsetView @@ -785,7 +785,7 @@ """ id = 'search-associate' title = _('search for association') - __selectors__ = (one_line_rset, match_search_state, accept_selector) + __selectors__ = (one_line_rset, match_search_state, accept) accepts = ('Any',) search_states = ('linksearch',) @@ -842,7 +842,7 @@ """ id = 'editrelation' - __selectors__ = (req_form_params_selector,) + __selectors__ = (match_form_params,) form_params = ('rtype',) # TODO: inlineview, multiple edit, (widget view ?) diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/boxes.py --- a/web/views/boxes.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/boxes.py Thu Jan 15 13:27:33 2009 +0100 @@ -17,7 +17,7 @@ from logilab.mtconverter import html_escape -from cubicweb.common.selectors import (rset_selector, appobject_selectable) +from cubicweb.common.selectors import (any_rset, appobject_selectable) from cubicweb.web.htmlwidgets import BoxWidget, BoxMenu, BoxHtml, RawBoxItem from cubicweb.web.box import BoxTemplate, ExtResourcesBoxTemplate @@ -29,7 +29,7 @@ box with all actions impacting the entity displayed: edit, copy, delete change state, add related entities """ - __selectors__ = (rset_selector,) + BoxTemplate.__selectors__ + __selectors__ = (any_rset,) + BoxTemplate.__selectors__ id = 'edit_box' title = _('actions') order = 2 diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/calendar.py --- a/web/views/calendar.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/calendar.py Thu Jan 15 13:27:33 2009 +0100 @@ -15,7 +15,7 @@ from cubicweb.interfaces import ICalendarable from cubicweb.common.utils import date_range from cubicweb.common.uilib import ajax_replace_url -from cubicweb.common.selectors import interface_selector +from cubicweb.common.selectors import implement_interface from cubicweb.common.registerers import priority_registerer from cubicweb.common.view import EntityView @@ -83,7 +83,7 @@ Does apply to ICalendarable compatible entities """ __registerer__ = priority_registerer - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) accepts_interfaces = (ICalendarable,) need_navigation = False content_type = 'text/calendar' @@ -114,7 +114,7 @@ Does apply to ICalendarable compatible entities """ __registerer__ = priority_registerer - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) accepts_interfaces = (ICalendarable,) need_navigation = False title = _('hCalendar') @@ -146,7 +146,7 @@ class OneMonthCal(EntityView): """At some point, this view will probably replace ampm calendars""" __registerer__ = priority_registerer - __selectors__ = (interface_selector, ) + __selectors__ = (implement_interface, ) accepts_interfaces = (ICalendarable,) need_navigation = False id = 'onemonthcal' @@ -331,7 +331,7 @@ class OneWeekCal(EntityView): """At some point, this view will probably replace ampm calendars""" __registerer__ = priority_registerer - __selectors__ = (interface_selector, ) + __selectors__ = (implement_interface, ) accepts_interfaces = (ICalendarable,) need_navigation = False id = 'oneweekcal' diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/embedding.py --- a/web/views/embedding.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/embedding.py Thu Jan 15 13:27:33 2009 +0100 @@ -18,7 +18,7 @@ from cubicweb.interfaces import IEmbedable from cubicweb.common.uilib import soup2xhtml from cubicweb.common.selectors import (one_line_rset, score_entity_selector, - match_search_state, interface_selector) + match_search_state, implement_interface) from cubicweb.common.view import NOINDEX, NOFOLLOW from cubicweb.web.controller import Controller from cubicweb.web.action import Action @@ -82,7 +82,7 @@ id = 'embed' controller = 'embed' __selectors__ = (one_line_rset, match_search_state, - interface_selector, score_entity_selector) + implement_interface, score_entity_selector) accepts_interfaces = (IEmbedable,) title = _('embed') diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/facets.py --- a/web/views/facets.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/facets.py Thu Jan 15 13:27:33 2009 +0100 @@ -10,9 +10,9 @@ from logilab.mtconverter import html_escape -from cubicweb.common.selectors import (chainfirst, chainall, nfentity_selector, - two_lines_rset, contextprop_selector, - yes, one_has_relation_selector) +from cubicweb.common.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) @@ -28,8 +28,8 @@ """filter results of a query""" id = 'filter_box' __selectors__ = (chainfirst(contextview_selector, - chainall(nfentity_selector, two_lines_rset)), - contextprop_selector) + chainall(non_final_entity, two_lines_rset)), + match_context_prop) context = 'left' title = _('boxes_filter_box') visible = True # functionality provided by the search box by default @@ -153,7 +153,7 @@ class HasTextFacet(AbstractFacet): - __selectors__ = (one_has_relation_selector, contextprop_selector) + __selectors__ = (one_has_relation, match_context_prop) id = 'has_text-facet' rtype = 'has_text' role = 'subject' diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/ibreadcrumbs.py --- a/web/views/ibreadcrumbs.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/ibreadcrumbs.py Thu Jan 15 13:27:33 2009 +0100 @@ -9,8 +9,8 @@ from logilab.mtconverter import html_escape from cubicweb.interfaces import IBreadCrumbs -from cubicweb.common.selectors import (contextprop_selector, one_line_rset, - interface_selector) +from cubicweb.common.selectors import (match_context_prop, one_line_rset, + implement_interface) 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,7 +29,7 @@ # register msg not generated since no entity implements IPrevNext in cubicweb itself title = _('contentnavigation_breadcrumbs') help = _('contentnavigation_breadcrumbs_description') - __selectors__ = (one_line_rset, contextprop_selector, interface_selector) + __selectors__ = (one_line_rset, match_context_prop, implement_interface) accepts_interfaces = (IBreadCrumbs,) context = 'navtop' order = 5 @@ -73,7 +73,7 @@ class BreadCrumbComponent(BreadCrumbEntityVComponent): __registry__ = 'components' - __selectors__ = (one_line_rset, interface_selector) + __selectors__ = (one_line_rset, implement_interface) visible = True diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/idownloadable.py --- a/web/views/idownloadable.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/idownloadable.py Thu Jan 15 13:27:33 2009 +0100 @@ -11,7 +11,7 @@ from cubicweb.interfaces import IDownloadable from cubicweb.common.mttransforms import ENGINE from cubicweb.common.selectors import (one_line_rset, score_entity_selector, - interface_selector, contextprop_selector) + implement_interface, match_context_prop) from cubicweb.web.box import EntityBoxTemplate from cubicweb.web.views import baseviews @@ -35,7 +35,7 @@ class DownloadBox(EntityBoxTemplate): id = 'download_box' - __selectors__ = (one_line_rset, interface_selector, contextprop_selector) + __selectors__ = (one_line_rset, implement_interface, match_context_prop) accepts_interfaces = (IDownloadable,) order = 10 def cell_call(self, row, col, title=None, label=None, **kwargs): @@ -48,7 +48,7 @@ of entities providing the necessary interface """ id = 'download' - __selectors__ = (one_line_rset, interface_selector) + __selectors__ = (one_line_rset, implement_interface) accepts_interfaces = (IDownloadable,) templatable = False @@ -77,7 +77,7 @@ """view displaying a link to download the file""" id = 'downloadlink' title = None # should not be listed in possible views - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) accepts_interfaces = (IDownloadable,) @@ -89,7 +89,7 @@ class IDownloadablePrimaryView(baseviews.PrimaryView): - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) #skip_attrs = ('eid', 'data',) # XXX accepts_interfaces = (IDownloadable,) @@ -122,7 +122,7 @@ class IDownloadableLineView(baseviews.OneLineView): - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) # don't kick default oneline view accepts_interfaces = (IDownloadable,) @@ -138,7 +138,7 @@ class ImageView(baseviews.EntityView): - __selectors__ = (interface_selector, score_entity_selector) + __selectors__ = (implement_interface, score_entity_selector) id = 'image' title = _('image') accepts_interfaces = (IDownloadable,) diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/igeocodable.py --- a/web/views/igeocodable.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/igeocodable.py Thu Jan 15 13:27:33 2009 +0100 @@ -4,7 +4,7 @@ from cubicweb.interfaces import IGeocodable from cubicweb.common.view import EntityView -from cubicweb.common.selectors import interface_selector +from cubicweb.common.selectors import implement_interface class GeocodingJsonView(EntityView): id = 'geocoding-json' @@ -12,7 +12,7 @@ templatable = False content_type = 'application/json' - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) accepts_interfaces = (IGeocodable,) def call(self): @@ -44,7 +44,7 @@ class GoogleMapBubbleView(EntityView): id = 'gmap-bubble' - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) accepts_interfaces = (IGeocodable,) def cell_call(self, row, col): @@ -56,7 +56,7 @@ class GoogleMapsView(EntityView): id = 'gmap-view' - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) accepts_interfaces = (IGeocodable,) need_navigation = False diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/iprogress.py --- a/web/views/iprogress.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/iprogress.py Thu Jan 15 13:27:33 2009 +0100 @@ -12,7 +12,7 @@ from cubicweb.interfaces import IProgress, IMileStone from cubicweb.schema import display_name from cubicweb.common.view import EntityView -from cubicweb.common.selectors import interface_selector, accept_selector +from cubicweb.common.selectors import implement_interface, accept from cubicweb.web.htmlwidgets import ProgressBarWidget @@ -35,7 +35,7 @@ id = 'progress_table_view' title = _('task progression') - __selectors__ = (accept_selector, interface_selector) + __selectors__ = (accept, implement_interface) accepts_interfaces = (IMileStone,) @@ -182,7 +182,7 @@ """displays a progress bar""" id = 'progressbar' title = _('progress bar') - __selectors__ = (accept_selector, interface_selector) + __selectors__ = (accept, implement_interface) accepts_interfaces = (IProgress,) diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/management.py --- a/web/views/management.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/management.py Thu Jan 15 13:27:33 2009 +0100 @@ -16,7 +16,7 @@ from cubicweb.common.uilib import (html_traceback, rest_traceback, html_escape, toggle_link) from cubicweb.common.selectors import (yes, one_line_rset, - accept_rset_selector, none_rset, + accept_rset, none_rset, chainfirst, chainall) from cubicweb.web import INTERNAL_FIELD_VALUE, eid_param, stdmsgs from cubicweb.web.widgets import StaticComboBoxWidget @@ -440,7 +440,7 @@ title = _('preferences') require_groups = ('users', 'managers') # we don't want guests to be able to come here __selectors__ = chainfirst(none_rset, - chainall(one_line_rset, accept_rset_selector)), + chainall(one_line_rset, accept_rset)), accepts = ('EUser',) @classmethod diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/massmailing.py --- a/web/views/massmailing.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/massmailing.py Thu Jan 15 13:27:33 2009 +0100 @@ -11,14 +11,14 @@ from cubicweb.interfaces import IEmailable from cubicweb.common.view import EntityView -from cubicweb.common.selectors import interface_selector, in_group_selector +from cubicweb.common.selectors import implement_interface, match_user_group from cubicweb.web.action import EntityAction from cubicweb.web import stdmsgs class SendEmailAction(EntityAction): category = 'mainactions' - __selectors__ = (interface_selector, in_group_selector) + __selectors__ = (implement_interface, match_user_group) accepts_interfaces = (IEmailable,) # XXX should check email is set as well require_groups = ('managers', 'users') @@ -35,7 +35,7 @@ class MassMailingForm(EntityView): id = 'massmailing' - __selectors__ = (interface_selector, in_group_selector) + __selectors__ = (implement_interface, match_user_group) accepts_interfaces = (IEmailable,) require_groups = ('managers', 'users') diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/navigation.py --- a/web/views/navigation.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/navigation.py Thu Jan 15 13:27:33 2009 +0100 @@ -12,8 +12,8 @@ from cubicweb.interfaces import IPrevNext from cubicweb.common.selectors import (paginated_rset, sortedrset_selector, - primaryview_selector, contextprop_selector, - one_line_rset, interface_selector) + primary_view, match_context_prop, + one_line_rset, implement_interface) from cubicweb.common.uilib import cut from cubicweb.web.component import EntityVComponent, NavigationComponent @@ -176,8 +176,8 @@ # itself title = _('contentnavigation_prevnext') help = _('contentnavigation_prevnext_description') - __selectors__ = (one_line_rset, primaryview_selector, - contextprop_selector, interface_selector) + __selectors__ = (one_line_rset, primary_view, + match_context_prop, implement_interface) accepts_interfaces = (IPrevNext,) context = 'navbottom' order = 10 diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/old_calendar.py --- a/web/views/old_calendar.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/old_calendar.py Thu Jan 15 13:27:33 2009 +0100 @@ -11,7 +11,7 @@ from cubicweb.interfaces import ICalendarViews from cubicweb.common.utils import date_range -from cubicweb.common.selectors import interface_selector +from cubicweb.common.selectors import implement_interface from cubicweb.common.registerers import priority_registerer from cubicweb.common.view import EntityView @@ -33,7 +33,7 @@ class _CalendarView(EntityView): """base calendar view containing helpful methods to build calendar views""" __registerer__ = priority_registerer - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) accepts_interfaces = (ICalendarViews,) need_navigation = False diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/tableview.py --- a/web/views/tableview.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/tableview.py Thu Jan 15 13:27:33 2009 +0100 @@ -14,8 +14,8 @@ 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, req_form_params_selector, - accept_rset_selector) +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 @@ -249,7 +249,7 @@ class CellView(EntityView): - __selectors__ = (nonempty_rset, accept_rset_selector) + __selectors__ = (nonempty_rset, accept_rset) id = 'cell' accepts = ('Any',) @@ -285,7 +285,7 @@ displayed with default restrictions set """ id = 'initialtable' - __selectors__ = nonempty_rset, req_form_params_selector + __selectors__ = nonempty_rset, match_form_params form_params = ('actualrql',) # should not be displayed in possible view since it expects some specific # parameters diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/timeline.py --- a/web/views/timeline.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/timeline.py Thu Jan 15 13:27:33 2009 +0100 @@ -14,7 +14,7 @@ from cubicweb.interfaces import ICalendarable from cubicweb.common.view import EntityView, StartupView -from cubicweb.common.selectors import interface_selector +from cubicweb.common.selectors import implement_interface # @@ -28,7 +28,7 @@ templatable = False content_type = 'application/json' - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) accepts_interfaces = (ICalendarable,) date_fmt = '%Y/%m/%d' @@ -103,7 +103,7 @@ class TimelineView(TimelineViewMixIn, EntityView): """builds a cubicweb timeline widget node""" id = 'timeline' - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) accepts_interfaces = (ICalendarable,) need_navigation = False def call(self, tlunit=None): diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/timetable.py --- a/web/views/timetable.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/timetable.py Thu Jan 15 13:27:33 2009 +0100 @@ -9,7 +9,7 @@ from cubicweb.interfaces import ITimetableViews from cubicweb.common.utils import date_range -from cubicweb.common.selectors import interface_selector +from cubicweb.common.selectors import implement_interface from cubicweb.common.view import AnyRsetView @@ -25,7 +25,7 @@ class TimeTableView(AnyRsetView): id = 'timetable' title = _('timetable') - __selectors__ = (interface_selector,) + __selectors__ = (implement_interface,) accepts_interfaces = (ITimetableViews,) need_navigation = False diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/treeview.py --- a/web/views/treeview.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/treeview.py Thu Jan 15 13:27:33 2009 +0100 @@ -1,7 +1,7 @@ from logilab.mtconverter import html_escape from cubicweb.interfaces import ITree -from cubicweb.common.selectors import interface_selector, yes +from cubicweb.common.selectors import implement_interface, yes from cubicweb.common.view import EntityView from cubicweb.web.views.baseviews import OneLineView @@ -87,7 +87,7 @@ id = 'treeitemview' # XXX append yes to make sure we get an higher score than # the default treeitem view - __selectors__ = (interface_selector, yes) + __selectors__ = (implement_interface, yes) accepts_interfaces = (ITree,) def cell_call(self, row, col, vid='oneline', parentvid='treeview'): diff -r 6fbc0ab79a2d -r 18b4dd650ef8 web/views/wdoc.py --- a/web/views/wdoc.py Thu Jan 15 13:27:17 2009 +0100 +++ b/web/views/wdoc.py Thu Jan 15 13:27:33 2009 +0100 @@ -15,7 +15,7 @@ from logilab.common.changelog import ChangeLog from logilab.mtconverter import CHARSET_DECL_RGX -from cubicweb.common.selectors import req_form_params_selector +from cubicweb.common.selectors import match_form_params from cubicweb.common.view import StartupView from cubicweb.common.uilib import rest_publish from cubicweb.web import NotFound @@ -85,7 +85,7 @@ # help views ################################################################## class InlineHelpView(StartupView): - __selectors__ = (req_form_params_selector,) + __selectors__ = (match_form_params,) form_params = ('fid',) id = 'wdoc' title = _('site documentation') @@ -163,7 +163,7 @@ class InlineHelpImageView(StartupView): - __selectors__ = (req_form_params_selector,) + __selectors__ = (match_form_params,) form_params = ('fid',) id = 'wdocimages' binary = True