selectors.py
changeset 2657 de974465d381
parent 2650 18aec79ec3a3
child 2788 8d3dbe577d3a
child 2970 d83f5d96e1d7
--- a/selectors.py	Mon Aug 03 14:14:07 2009 +0200
+++ b/selectors.py	Mon Aug 03 15:16:47 2009 +0200
@@ -53,8 +53,8 @@
 
 from cubicweb import (Unauthorized, NoSelectableObject, NotAnEntity,
                       role, typed_eid)
-from cubicweb.vregistry import (NoSelectableObject, Selector,
-                                chainall, objectify_selector)
+# even if not used, let yes here so it's importable through this module
+from cubicweb.appobject import Selector, objectify_selector, yes
 from cubicweb.cwconfig import CubicWebConfiguration
 from cubicweb.schema import split_expression
 
@@ -274,17 +274,6 @@
 
 # very basic selectors ########################################################
 
-class yes(Selector):
-    """return arbitrary score
-
-    default score of 0.5 so any other selector take precedence
-    """
-    def __init__(self, score=0.5):
-        self.score = score
-
-    def __call__(self, *args, **kwargs):
-        return self.score
-
 @objectify_selector
 @lltrace
 def none_rset(cls, req, rset=None, **kwargs):
@@ -975,6 +964,7 @@
 
 
 # XXX DEPRECATED ##############################################################
+from cubicweb.vregistry import chainall
 
 yes_selector = deprecated()(yes)
 norset_selector = deprecated()(none_rset)
@@ -1040,7 +1030,7 @@
 accept_selector = deprecated()(accept)
 
 accept_one = deprecated()(chainall(one_line_rset, accept,
-                                          name='accept_one'))
+                                   name='accept_one'))
 accept_one_selector = deprecated()(accept_one)