kill kick_registerer (actually moved to asteretud), fix _accepts_interface w/ new implements selector tls-sprint
authorsylvain.thenault@logilab.fr
Tue, 17 Feb 2009 21:42:06 +0100
branchtls-sprint
changeset 694 520661be60e4
parent 693 cf0817dfc787
child 695 356da23c57f1
kill kick_registerer (actually moved to asteretud), fix _accepts_interface w/ new implements selector
common/registerers.py
--- a/common/registerers.py	Tue Feb 17 21:40:10 2009 +0100
+++ b/common/registerers.py	Tue Feb 17 21:42:06 2009 +0100
@@ -11,9 +11,12 @@
 __docformat__ = "restructuredtext en"
 
 from cubicweb.vregistry import registerer
-
+from cubicweb.selectors import implements
 
 def _accepts_interfaces(obj):
+    impl = obj.__select__.search_selector(implements)
+    if impl:
+        return sorted(impl.expected_ifaces)
     return sorted(getattr(obj, 'accepts_interfaces', ()))
 
 
@@ -54,17 +57,6 @@
 
     def equivalent(self, other):
         raise NotImplementedError(self, self.vobject)
-
-
-class kick_registerer(registerer):
-    """systematically kick previous registered class and don't register the
-    wrapped class. This is temporarily used to discard library object registrable
-    but that we don't want to use
-    """
-    def do_it_yourself(self, registered):
-        if registered:
-            self.kick(registered, registered[-1])
-        return 
     
 
 class accepts_registerer(priority_registerer):