cwconfig.py
branchstable
changeset 6799 30faf6021278
parent 6788 0f31ed3fff79
child 6844 5ae2bc554c23
equal deleted inserted replaced
6798:c3d5c0a215b7 6799:30faf6021278
   448                 extrapath[cubesdir] = 'cubes'
   448                 extrapath[cubesdir] = 'cubes'
   449         return extrapath
   449         return extrapath
   450 
   450 
   451     @classmethod
   451     @classmethod
   452     def cube_dir(cls, cube):
   452     def cube_dir(cls, cube):
   453         """return the cube directory for the given cube id,
   453         """return the cube directory for the given cube id, raise
   454         raise `ConfigurationError` if it doesn't exists
   454         `ConfigurationError` if it doesn't exist
   455         """
   455         """
   456         for directory in cls.cubes_search_path():
   456         for directory in cls.cubes_search_path():
   457             cubedir = join(directory, cube)
   457             cubedir = join(directory, cube)
   458             if exists(cubedir):
   458             if exists(cubedir):
   459                 return cubedir
   459                 return cubedir
   460         raise ConfigurationError('no cube %s in %s' % (cube, cls.cubes_search_path()))
   460         raise ConfigurationError('no cube %r in %s' % (
       
   461             cube, cls.cubes_search_path()))
   461 
   462 
   462     @classmethod
   463     @classmethod
   463     def cube_migration_scripts_dir(cls, cube):
   464     def cube_migration_scripts_dir(cls, cube):
   464         """cube migration scripts directory"""
   465         """cube migration scripts directory"""
   465         return join(cls.cube_dir(cube), 'migration')
   466         return join(cls.cube_dir(cube), 'migration')