summaryrefslogtreecommitdiff
path: root/jfr_playoff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-08-01 14:05:59 +0200
committeremkael <emkael@tlen.pl>2017-08-01 14:05:59 +0200
commitde7260322d60eeb5fd0afa57ec2e250ce7f52261 (patch)
tree1f568947519abfc30811ac1a2e5e705af8762941 /jfr_playoff
parent126729817b8626a597b61bcc59f8a6441e480691 (diff)
Settings are not used as class attributes once loaded, so can remain local to constructor
Diffstat (limited to 'jfr_playoff')
-rw-r--r--jfr_playoff/data.py7
-rw-r--r--jfr_playoff/filemanager.py9
-rw-r--r--jfr_playoff/generator.py9
3 files changed, 12 insertions, 13 deletions
diff --git a/jfr_playoff/data.py b/jfr_playoff/data.py
index b54d1ae..db65393 100644
--- a/jfr_playoff/data.py
+++ b/jfr_playoff/data.py
@@ -9,10 +9,9 @@ from jfr_playoff.dto import Match, Phase, Team
class PlayoffData(object):
def __init__(self, settings):
- self.settings = settings
- self.database = PlayoffDB(self.settings.get('database'))
- self.phases = self.settings.get('phases')
- self.teams = self.settings.get('teams')
+ self.database = PlayoffDB(settings.get('database'))
+ self.phases = settings.get('phases')
+ self.teams = settings.get('teams')
self.grid = []
self.match_info = {}
self.leaderboard = []
diff --git a/jfr_playoff/filemanager.py b/jfr_playoff/filemanager.py
index 2c443b4..03dbaf7 100644
--- a/jfr_playoff/filemanager.py
+++ b/jfr_playoff/filemanager.py
@@ -8,10 +8,11 @@ import __main__
class PlayoffFileManager(object):
def __init__(self, settings):
- self.settings = settings
- self.goniec = self.settings.get('goniec')
- self.output_file = self.settings.get('output')
- self.output_path = os.path.dirname(self.output_file).strip(os.sep) + os.sep
+ self.goniec = settings.get('goniec')
+ self.output_file = settings.get('output')
+ self.output_path = os.path.dirname(
+ self.output_file
+ ).strip(os.sep) + os.sep
self.files = set()
def reset(self):
diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py
index e3e8221..bc2a388 100644
--- a/jfr_playoff/generator.py
+++ b/jfr_playoff/generator.py
@@ -6,12 +6,11 @@ from jfr_playoff.data import PlayoffData
class PlayoffGenerator(object):
def __init__(self, settings):
- self.settings = settings
- self.data = PlayoffData(self.settings)
- self.page = self.settings.get('page')
+ self.data = PlayoffData(settings)
+ self.page = settings.get('page')
self.canvas = {}
- if self.settings.has_section('canvas'):
- self.canvas = self.settings.get('canvas')
+ if settings.has_section('canvas'):
+ self.canvas = settings.get('canvas')
def generate_content(self):
return p_temp.PAGE % (