From 830aaabd3e8105ad47460628587660cb496f507e Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 5 Jan 2017 11:07:11 +0100 Subject: Refactoring - grouping calculation methods --- ausbutler/interface.py | 6 ++++++ butler.py | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ausbutler/interface.py b/ausbutler/interface.py index 5f194cd..bbbaeda 100644 --- a/ausbutler/interface.py +++ b/ausbutler/interface.py @@ -11,6 +11,12 @@ class Interface(object): self.session = get_session() self.config = config + def calculate_all(self): + self.init_db() + self.populate_db() + self.opp_scores() + self.normalize_scores() + def init_db(self, force=False): from .model import Base if force: diff --git a/butler.py b/butler.py index 6f3a2d4..655a11f 100644 --- a/butler.py +++ b/butler.py @@ -7,7 +7,4 @@ from ausbutler.interface import Interface i = Interface(json.load( open(path.join(path.dirname(__main__.__file__), 'config', 'butler.json')))) -i.init_db() -i.populate_db() -i.opp_scores() -i.normalize_scores() +i.calculate_all() -- cgit v1.2.3