# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1234903326 -3600 # Node ID 520661be60e485fc6ac9a24baf864e7643a86f97 # Parent cf0817dfc78761f50930512e8d35ffeae3118672 kill kick_registerer (actually moved to asteretud), fix _accepts_interface w/ new implements selector diff -r cf0817dfc787 -r 520661be60e4 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):