diff options
author | emkael <emkael@tlen.pl> | 2017-08-01 01:37:21 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-08-01 01:40:59 +0200 |
commit | 022f2cc6d067769a6c8e56601c0238aac69ec9ab (patch) | |
tree | 6140d81d9981d5462417e3a9d29c9461f984bcb4 /jfr_playoff/settings.py | |
parent | 437666456efe3d3088838855989bc9f876531d98 (diff) |
Load config file only once
Diffstat (limited to 'jfr_playoff/settings.py')
-rw-r--r-- | jfr_playoff/settings.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/jfr_playoff/settings.py b/jfr_playoff/settings.py index d81d8a8..e69b1d3 100644 --- a/jfr_playoff/settings.py +++ b/jfr_playoff/settings.py @@ -6,6 +6,7 @@ def complete_filename(text, state): class PlayoffSettings: def __init__(self): + self.settings = None self.interactive = False self.settings_file = None if len(sys.argv) > 1: @@ -20,7 +21,8 @@ class PlayoffSettings: readline.set_completer(complete_filename) self.settings_file = raw_input('JSON settings file: ') - self.settings = json.load(open(self.settings_file)) + if self.settings is None: + self.settings = json.load(open(self.settings_file)) def has_section(self, key): self.load() |