[cwconfig] drop _cube_modname
Since we drop support for legacy cubes, this is equivalent to _cube_pkgname()
--- a/cubicweb/cwconfig.py Wed Mar 27 16:19:50 2019 +0100
+++ b/cubicweb/cwconfig.py Wed Mar 27 16:25:06 2019 +0100
@@ -242,15 +242,6 @@
return cube
-def _cube_modname(cube):
- modname = _cube_pkgname(cube)
- loader = pkgutil.find_loader(modname)
- if loader:
- return modname
- else:
- return 'cubes.' + cube
-
-
def _expand_modname(modname, recursive=True):
"""expand modules names `modname` if exists by recursively walking
submodules and subpackages and yield (submodname, filepath) including
@@ -766,7 +757,7 @@
modnames.append(('cubicweb', 'cubicweb.schemas.' + name))
for cube in reversed(self.cubes()):
for modname, filepath in _expand_modname(
- '{0}.schema'.format(_cube_modname(cube)),
+ '{0}.schema'.format(_cube_pkgname(cube)),
recursive=False):
modnames.append((cube, modname))
if self.apphome:
@@ -1284,7 +1275,7 @@
def appobjects_cube_modnames(self, cube):
modnames = []
- cube_modname = _cube_modname(cube)
+ cube_modname = _cube_pkgname(cube)
cube_submodnames = self._sorted_appobjects(self.cube_appobject_path)
for name in cube_submodnames:
for modname, filepath in _expand_modname('.'.join([cube_modname, name])):