From 54fda32331ea1319b5018c4482ab82e6f9166f1e Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 16 Nov 2016 22:32:26 +0100 Subject: * factoring Goniec params gathering out to separate method --- src/bidding_data_gui.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/bidding_data_gui.py b/src/bidding_data_gui.py index caaa10c..4f95152 100644 --- a/src/bidding_data_gui.py +++ b/src/bidding_data_gui.py @@ -57,10 +57,7 @@ class BiddingGUI(tk.Frame): raise Exception('Tournament results file not found') # Goniec parameters/switches - goniec_params = '%s:%d' % ( - self.__variables['goniec_host'].get(), - self.__variables['goniec_port'].get() - ) if self.__variables['goniec_enabled'].get() == 1 else None + goniec_params = self.__compile_goniec_params() # do the magic from bidding_data import JFRBidding @@ -576,6 +573,12 @@ class BiddingGUI(tk.Frame): json.dump(self.__default_config, file(CONFIG_FILE, 'w'), sort_keys=True, indent=4) + def __compile_goniec_params(self): + return '%s:%d' % ( + self.__variables['goniec_host'].get(), + self.__variables['goniec_port'].get() + ) if self.__variables['goniec_enabled'].get() == 1 else None + def main(): """Entry point for application - spawn main window.""" -- cgit v1.2.3