1 2class ConnectionInfo: 3 def __init__(self): 4 self.connected = False 5 self.connectorStatuses = {} 6 self.connectionHandlers = {} 7 self.listenerStatus = (None, None) 8 self.winningHint = None 9 self.establishedAt = None 10 self.lostAt = None 11 12 def _set_connected(self, connected): 13 self.connected = connected 14 15 def _set_connection_status(self, location, status): 16 self.connectorStatuses[location] = status 17 def _describe_connection_handler(self, location, description): 18 self.connectionHandlers[location] = description 19 def _set_established_at(self, when): 20 self.establishedAt = when 21 def _set_winning_hint(self, location): 22 self.winningHint = location 23 def _set_listener_description(self, description): 24 self.listenerStatus = (description, self.listenerStatus[1]) 25 def _set_listener_status(self, status): 26 self.listenerStatus = (self.listenerStatus[0], status) 27 def _set_lost_at(self, when): 28 self.lostAt = when 29