cubicweb/pyramid/core.py
changeset 12550 c6f832df2f34
parent 12542 85194bd49119
equal deleted inserted replaced
12549:e2db422752b4 12550:c6f832df2f34
   396     config.add_request_method(
   396     config.add_request_method(
   397         _cw_request, name='cw_request', property=True, reify=True)
   397         _cw_request, name='cw_request', property=True, reify=True)
   398 
   398 
   399     cwcfg = config.registry['cubicweb.config']
   399     cwcfg = config.registry['cubicweb.config']
   400     for cube in cwcfg.cubes():
   400     for cube in cwcfg.cubes():
   401         try:
   401         pkgname = 'cubicweb_{}'.format(cube)
   402             pkgname = 'cubicweb_{}'.format(cube)
   402         mod = __import__(pkgname)
   403             mod = __import__(pkgname)
       
   404         except ImportError:
       
   405             pkgname = 'cubes.{}'.format(cube)
       
   406             mod = __import__(pkgname)
       
   407             mod = getattr(mod, cube)
       
   408         if hasattr(mod, 'includeme'):
   403         if hasattr(mod, 'includeme'):
   409             config.include(pkgname)
   404             config.include(pkgname)