From c21b6f9e962ebce1c749d89d77a8203bddcce6d1 Mon Sep 17 00:00:00 2001 From: Frederic Date: Fri, 28 Apr 2017 18:48:22 +0200 Subject: [PATCH] removed @property functions --- configreader.py | 28 ++++++---------------------- statemachine.py | 18 +++--------------- 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/configreader.py b/configreader.py index ddee9e1..14514dd 100644 --- a/configreader.py +++ b/configreader.py @@ -22,10 +22,9 @@ class ConfigurationReader(object): def __init__(self): self.__cp = ConfigParser.ConfigParser(defaults=ConfigurationReader.DEFAULTS) - self.__pinconfig = None - self.__dialconfig = None - self.__proxyconfigs = None - self.__phoneconfig = None + self.pinconfig = None + self.dialconfig = None + self.phoneconfig = None def __get_global_val(self, option): @@ -69,7 +68,7 @@ class ConfigurationReader(object): self.__cp.read(f) print 'pin_nsa:', self.__get_global_val_int('pin_nsa'), - self.__pinconfig = apparatinterface.FeApPinConfiguration( + self.pinconfig = apparatinterface.FeApPinConfiguration( gpio_numbering = self.__get_global_val('gpio_numbering'), pin_nsa = self.__get_global_val_int('pin_nsa'), pin_nsi = self.__get_global_val_int('pin_nsi'), @@ -81,7 +80,7 @@ class ConfigurationReader(object): invert_gs = self.__get_global_val_bool('invert_gs'), ) - self.__dialconfig = statemachine.DialConfiguration( + self.dialconfig = statemachine.DialConfiguration( self.__get_global_val_int('dial_timeout'), self.__read_shortcuts(), self.__read_blacklist(), @@ -102,7 +101,7 @@ class ConfigurationReader(object): ) proxyconfigs.append(proxyconfig) - self.__phoneconfig = phoneinterface.PhoneConfiguration( + self.phoneconfig = phoneinterface.PhoneConfiguration( sound_device = self.__get_global_val('sound_device'), incoming_timeout = self.__get_global_val_int('incoming_timeout'), linphone_config = self.__get_global_val('linphone_config'), @@ -111,18 +110,3 @@ class ConfigurationReader(object): proxies = proxyconfigs ) - - @property - def pinconfig(self): - return self.__pinconfig - - - @property - def dialconfig(self): - return self.__dialconfig - - - @property - def phoneconfig(self): - return self.__phoneconfig - diff --git a/statemachine.py b/statemachine.py index 0b1373a..11fc543 100644 --- a/statemachine.py +++ b/statemachine.py @@ -259,9 +259,9 @@ class DialingState(BaseState): class StateMachineController(object): def __init__(self, phone, feap, dialconfig): - self.__phone = phone - self.__feap = feap - self.__dialconfig = dialconfig + self.phone = phone + self.feap = feap + self.dialconfig = dialconfig self.__state = InitState(self) @@ -308,18 +308,6 @@ class StateMachineController(object): self.__timeout.cancel() self.__timeout = None - @property - def phone(self): - return self.__phone - - @property - def feap(self): - return self.__feap - - @property - def dialconfig(self): - return self.__dialconfig - def stop(self, hard=False): if hard: self.__running = False