From 18af1394a8b732d94b48b8f13e78cfcae3e45a6e Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Fri, 15 May 2015 10:40:17 +0200 Subject: Move Class-Level variables to the Instances I should really learn python… MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- voctocore/lib/tcpmulticonnection.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'voctocore/lib/tcpmulticonnection.py') diff --git a/voctocore/lib/tcpmulticonnection.py b/voctocore/lib/tcpmulticonnection.py index 2ca6921..201ecde 100644 --- a/voctocore/lib/tcpmulticonnection.py +++ b/voctocore/lib/tcpmulticonnection.py @@ -5,16 +5,15 @@ from gi.repository import GObject from lib.config import Config class TCPMultiConnection(object): - log = logging.getLogger('TCPMultiConnection') - - port = None - - boundSocket = None - currentConnections = [] - - def __init__(self, port): + if not hasattr(self, 'log'): + self.log = logging.getLogger('TCPMultiConnection') + self.port = port + self.port = None + + self.boundSocket = None + self.currentConnections = [] self.log.debug('Binding to Source-Socket on [::]:%u', port) self.boundSocket = socket.socket(socket.AF_INET6) -- cgit v1.2.3