update setup.py

This commit is contained in:
Emmanuel Garette 2016-03-10 14:50:27 +01:00
parent 3b872cb8c9
commit 8c733d5303
2 changed files with 12 additions and 9 deletions

View File

@ -10,20 +10,22 @@ def fetch_version():
return file('VERSION', 'r').readline().strip() return file('VERSION', 'r').readline().strip()
def return_storages(): def return_files(component):
"returns all the storage plugins that are living in tiramisu/storage"
here = dirname(abspath(__file__)) here = dirname(abspath(__file__))
storages_path = normpath(join(here, 'tiramisu', 'storage')) path = normpath(join(here, 'tiramisu', component))
dir_content = [content for content in listdir(storages_path) dir_content = [content for content in listdir(path)
if not content == '__pycache__'] if not content == '__pycache__']
storages = filter(isdir, [join(storages_path, content) paths = filter(isdir, [join(path, content)
for content in dir_content]) for content in dir_content])
storage_list = ['.'.join(storage.split('/')[-3:]) for storage in storages] lst = ['.'.join(path.split('/')[-3:]) for path in paths]
return storage_list return lst
packages = ['tiramisu', 'tiramisu.storage'] packages = ['tiramisu', 'tiramisu.storage', 'tiramisu.option']
packages.extend(return_storages()) packages.extend(return_files('storage'))
packages.extend(return_files('option'))
print packages
setup( setup(
author="Tiramisu's team", author="Tiramisu's team",
author_email='contact@cadoles.com', author_email='contact@cadoles.com',

View File

@ -171,3 +171,4 @@ def test_owner_masterslaves():
cfg.cfgimpl_get_values().setowner(c, owners.user, 0) cfg.cfgimpl_get_values().setowner(c, owners.user, 0)
assert cfg.cfgimpl_get_values().getowner(c, 0) == owners.user assert cfg.cfgimpl_get_values().getowner(c, 0) == owners.user
assert cfg.cfgimpl_get_values().getowner(c, 1) == owners.default assert cfg.cfgimpl_get_values().getowner(c, 1) == owners.default
assert cfg.str == ['yes', None]