cubicweb/pyramid/core.py
changeset 12379 04348101688a
parent 12355 c703dc95c82e
parent 12349 7e670235174f
child 12491 540904e0ff0f
equal deleted inserted replaced
12378:9dcb5e4e705b 12379:04348101688a
   411     config.add_request_method(
   411     config.add_request_method(
   412         _cw_request, name='cw_request', property=True, reify=True)
   412         _cw_request, name='cw_request', property=True, reify=True)
   413 
   413 
   414     cwcfg = config.registry['cubicweb.config']
   414     cwcfg = config.registry['cubicweb.config']
   415     for cube in cwcfg.cubes():
   415     for cube in cwcfg.cubes():
   416         pkgname = 'cubes.' + cube
   416         try:
   417         mod = __import__(pkgname)
   417             pkgname = 'cubicweb_{}'.format(cube)
   418         mod = getattr(mod, cube)
   418             mod = __import__(pkgname)
       
   419         except ImportError:
       
   420             pkgname = 'cubes.{}'.format(cube)
       
   421             mod = __import__(pkgname)
       
   422             mod = getattr(mod, cube)
   419         if hasattr(mod, 'includeme'):
   423         if hasattr(mod, 'includeme'):
   420             config.include('cubes.' + cube)
   424             config.include(pkgname)