3 :organization: Logilab |
3 :organization: Logilab |
4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 """ |
6 """ |
7 __docformat__ = "restructuredtext en" |
7 __docformat__ = "restructuredtext en" |
|
8 _ = unicode |
8 |
9 |
9 from logilab.common.decorators import cached, clear_cache |
10 from logilab.common.decorators import cached, clear_cache |
10 |
11 |
11 from rql import RQLHelper |
12 from rql import RQLHelper |
12 |
13 |
13 from cubicweb import Binary, UnknownProperty, UnknownEid |
14 from cubicweb import Binary, UnknownProperty, UnknownEid |
14 from cubicweb.vregistry import VRegistry, ObjectNotFound, NoSelectableObject |
15 from cubicweb.vregistry import VRegistry, ObjectNotFound, NoSelectableObject |
15 |
16 from cubicweb.rtags import RTAGS |
16 _ = unicode |
17 |
17 |
18 |
18 def use_interfaces(obj): |
19 def use_interfaces(obj): |
19 """return interfaces used by the given object by searchinf for implements |
20 """return interfaces used by the given object by searchinf for implements |
20 selectors, with a bw compat fallback to accepts_interfaces attribute |
21 selectors, with a bw compat fallback to accepts_interfaces attribute |
21 """ |
22 """ |
120 self.debug('available in registry %s: %s', registry, |
121 self.debug('available in registry %s: %s', registry, |
121 sorted(objects)) |
122 sorted(objects)) |
122 for appobjects in objects.itervalues(): |
123 for appobjects in objects.itervalues(): |
123 for appobject in appobjects: |
124 for appobject in appobjects: |
124 appobject.vreg_initialization_completed() |
125 appobject.vreg_initialization_completed() |
125 from cubicweb.rtags import RTAGS |
126 # don't check rtags if we don't want to cleanup_interface_sobjects |
126 for rtag in RTAGS: |
127 for rtag in RTAGS: |
127 rtag.init(self.schema) |
128 rtag.init(self.schema, |
|
129 check=self.config.cleanup_interface_sobjects) |
128 |
130 |
129 def initialization_completed(self): |
131 def initialization_completed(self): |
130 # clear etype cache if you don't want to run into deep weirdness |
132 # clear etype cache if you don't want to run into deep weirdness |
131 clear_cache(self, 'etype_class') |
133 clear_cache(self, 'etype_class') |
132 # we may want to keep interface dependent objects (e.g.for i18n |
134 # we may want to keep interface dependent objects (e.g.for i18n |