diff options
author | emkael <emkael@tlen.pl> | 2018-02-21 14:45:43 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-02-21 14:45:43 +0100 |
commit | 46750ff7aad634a0dad21b23bc21c72eb709c6b8 (patch) | |
tree | 855253a159b146bed7c38e04916f5a0d225597e2 /jfr_playoff | |
parent | ccc54fde2f8c9301962e9c6f464d5f2eacd5506a (diff) |
Separating URL retrieval and JSON parsing
Diffstat (limited to 'jfr_playoff')
-rw-r--r-- | jfr_playoff/settings.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/jfr_playoff/settings.py b/jfr_playoff/settings.py index acfd417..1f97e5e 100644 --- a/jfr_playoff/settings.py +++ b/jfr_playoff/settings.py @@ -25,9 +25,8 @@ class PlayoffSettings(object): new_config=None, remote_url=None, overwrite=True): try: - remote_config = new_config if new_config is not None else \ - json.loads(urllib.urlopen( - remote_url).read().decode('utf-8-sig')) + remote_file = urllib.urlopen(remote_url).read().decode('utf-8-sig') + remote_config = new_config if new_config is not None else json.loads(remote_file) for key, value in remote_config.iteritems(): if (key not in base_config) or overwrite: base_config[key] = value |