From 6114d17dc3c82a5f38a7a81e364192195147e7a6 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 3 Dec 2015 18:07:08 +0000 Subject: [PATCH] Reconfig project dirs --- project/config/cli.py | 4 ++-- project/{utils.py => utils/config.py} | 4 ++-- project/{config => utils}/defaults.yml | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename project/{utils.py => utils/config.py} (85%) rename project/{config => utils}/defaults.yml (100%) 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