diff options
author | emkael <emkael@tlen.pl> | 2018-10-10 01:50:31 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-10-10 01:50:31 +0200 |
commit | 5a4595fa3dc1e20a33dfba251a4b1eb9be34c5ae (patch) | |
tree | c63f3d23139bea55bc2f6e39f03bfd3b2731165a | |
parent | 472d49ebfce14880e40421d91a5fd0e1dc104ca2 (diff) |
Config directory lookup in current directory first
-rw-r--r-- | ausbutler/config.py | 9 |
1 files changed, 6 insertions, 3 deletions
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'))) |