diff options
author | MaZderMind <github@mazdermind.de> | 2015-05-15 10:40:17 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-05-15 10:40:17 +0200 |
commit | 18af1394a8b732d94b48b8f13e78cfcae3e45a6e (patch) | |
tree | 277a4ed47ce1823742da57a9999b75dd1a265f22 /voctocore/lib/tcpsingleconnection.py | |
parent | 389f87470bc988a2e4c26b4ce6e23a313aafbaf0 (diff) |
Move Class-Level variables to the Instances
I should really learn python…
Diffstat (limited to 'voctocore/lib/tcpsingleconnection.py')
-rw-r--r-- | voctocore/lib/tcpsingleconnection.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/voctocore/lib/tcpsingleconnection.py b/voctocore/lib/tcpsingleconnection.py index d6a05ef..e604ce6 100644 --- a/voctocore/lib/tcpsingleconnection.py +++ b/voctocore/lib/tcpsingleconnection.py @@ -7,12 +7,10 @@ from lib.config import Config class TCPSingleConnection(object): log = logging.getLogger('TCPSingleConnection') - port = None - - boundSocket = None - currentConnection = None - def __init__(self, port): + if not hasattr(self, 'log'): + self.log = logging.getLogger('TCPMultiConnection') + self.port = port self.log.debug('Binding to Source-Socket on [::]:%u', port) @@ -22,6 +20,8 @@ class TCPSingleConnection(object): self.boundSocket.bind(('::', port)) self.boundSocket.listen(1) + self.currentConnection = None + self.log.debug('Setting GObject io-watch on Socket') GObject.io_add_watch(self.boundSocket, GObject.IO_IN, self.on_connect) |