diff --git a/project/config/cli.py b/project/config/cli.py index d37a126..c0ecb1b 100644 --- a/project/config/cli.py +++ b/project/config/cli.py @@ -1,8 +1,8 @@ import click -from project.utils import get_config +from project.utils import config @click.command('config') @click.argument('key') def cli(key): - print(get_config(key)) + print(config.get(key)) diff --git a/project/utils.py b/project/utils/config.py similarity index 85% rename from project/utils.py rename to project/utils/config.py index 0f59e68..788136d 100644 --- a/project/utils.py +++ b/project/utils/config.py @@ -19,12 +19,12 @@ def get_config_data(filename): return [] -DEFAULT_CONFIG = get_config_data(os.path.join(BASE_DIR, 'config', 'defaults.yml')) +DEFAULT_CONFIG = get_config_data(os.path.join(BASE_DIR, 'defaults.yml')) USER_CONFIG = get_config_data(os.path.expanduser(USER_CONFIG_DIR)) -def get_config(key): +def get(key): if USER_CONFIG and key in USER_CONFIG: return USER_CONFIG[key] elif DEFAULT_CONFIG and key in DEFAULT_CONFIG: diff --git a/project/config/defaults.yml b/project/utils/defaults.yml similarity index 100% rename from project/config/defaults.yml rename to project/utils/defaults.yml