summaryrefslogtreecommitdiff
path: root/jfr_playoff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-08-01 01:37:21 +0200
committeremkael <emkael@tlen.pl>2017-08-01 01:40:59 +0200
commit022f2cc6d067769a6c8e56601c0238aac69ec9ab (patch)
tree6140d81d9981d5462417e3a9d29c9461f984bcb4 /jfr_playoff
parent437666456efe3d3088838855989bc9f876531d98 (diff)
Load config file only once
Diffstat (limited to 'jfr_playoff')
-rw-r--r--jfr_playoff/settings.py4
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()