cubicweb/cwconfig.py
changeset 12783 842939e69f3a
parent 12738 a54037a68b14
child 12784 894d0fd94f73
equal deleted inserted replaced
12782:ea8801f10a72 12783:842939e69f3a
   496         version = cls.cube_pkginfo(cube).numversion
   496         version = cls.cube_pkginfo(cube).numversion
   497         assert len(version) == 3, version
   497         assert len(version) == 3, version
   498         return Version(version)
   498         return Version(version)
   499 
   499 
   500     @classmethod
   500     @classmethod
   501     def _cube_deps(cls, cube, key, oldkey):
   501     def _cube_deps(cls, cube, key):
   502         """return cubicweb cubes used by the given cube"""
   502         """return cubicweb cubes used by the given cube"""
   503         pkginfo = cls.cube_pkginfo(cube)
   503         pkginfo = cls.cube_pkginfo(cube)
   504         try:
   504         try:
   505             # explicit __xxx_cubes__ attribute
   505             # explicit __xxx_cubes__ attribute
   506             deps = getattr(pkginfo, key)
   506             deps = getattr(pkginfo, key)
   534             return None
   534             return None
   535 
   535 
   536     @classmethod
   536     @classmethod
   537     def cube_dependencies(cls, cube):
   537     def cube_dependencies(cls, cube):
   538         """return cubicweb cubes used by the given cube"""
   538         """return cubicweb cubes used by the given cube"""
   539         return cls._cube_deps(cube, '__depends_cubes__', '__use__')
   539         return cls._cube_deps(cube, '__depends_cubes__')
   540 
   540 
   541     @classmethod
   541     @classmethod
   542     def cube_recommends(cls, cube):
   542     def cube_recommends(cls, cube):
   543         """return cubicweb cubes recommended by the given cube"""
   543         """return cubicweb cubes recommended by the given cube"""
   544         return cls._cube_deps(cube, '__recommends_cubes__', '__recommend__')
   544         return cls._cube_deps(cube, '__recommends_cubes__')
   545 
   545 
   546     @classmethod
   546     @classmethod
   547     def expand_cubes(cls, cubes, with_recommends=False):
   547     def expand_cubes(cls, cubes, with_recommends=False):
   548         """expand the given list of top level cubes used by adding recursivly
   548         """expand the given list of top level cubes used by adding recursivly
   549         each cube dependencies
   549         each cube dependencies