From 5a4595fa3dc1e20a33dfba251a4b1eb9be34c5ae Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 10 Oct 2018 01:50:31 +0200 Subject: Config directory lookup in current directory first --- ausbutler/config.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ausbutler/config.py') diff --git a/ausbutler/config.py b/ausbutler/config.py index fc676e9..ef9efd7 100644 --- a/ausbutler/config.py +++ b/ausbutler/config.py @@ -5,6 +5,9 @@ import __main__ def load_config(filename): - return json.load( - open(path.join(path.dirname(__main__.__file__), - 'config', filename + '.json'))) + possible_directories = ['.', path.dirname(__main__.__file__)] + for directory in possible_directories: + if path.exists(path.join(directory, 'config')): + return json.load( + open(path.join(directory, 'config', + filename + '.json'))) -- cgit v1.2.3