--- a/cwconfig.py Fri Jan 22 08:49:16 2010 +0100
+++ b/cwconfig.py Fri Jan 22 10:07:03 2010 +0100
@@ -84,7 +84,7 @@
from os.path import exists, join, expanduser, abspath, normpath, basename, isdir
from warnings import warn
-from logilab.common.decorators import cached
+from logilab.common.decorators import cached, classproperty
from logilab.common.deprecation import deprecated
from logilab.common.logging_ext import set_log_methods, init_log
from logilab.common.configuration import (Configuration, Method,
@@ -356,6 +356,13 @@
path.append(cls.CUBES_DIR)
return path
+ @classproperty
+ def extrapath(cls):
+ extrapath = {}
+ for cubesdir in cls.cubes_search_path():
+ if cubesdir != cls.CUBES_DIR:
+ extrapath[cubesdir] = 'cubes'
+
@classmethod
def cube_dir(cls, cube):
"""return the cube directory for the given cube id,
--- a/cwvreg.py Fri Jan 22 08:49:16 2010 +0100
+++ b/cwvreg.py Fri Jan 22 10:07:03 2010 +0100
@@ -373,12 +373,8 @@
def _register_objects(self, path, force_reload=None):
"""overriden to remove objects requiring a missing interface"""
- extrapath = {}
- for cubesdir in self.config.cubes_search_path():
- if cubesdir != self.config.CUBES_DIR:
- extrapath[cubesdir] = 'cubes'
if super(CubicWebVRegistry, self).register_objects(path, force_reload,
- extrapath):
+ self.config.extrapath):
self.initialization_completed()
# don't check rtags if we don't want to cleanup_interface_sobjects
for rtag in RTAGS: