def __init__(self, connection_string): num_occurrences = connection_string.count(':') if num_occurrences == 0: self._host = connection_string self._port = self.DEFAULT_PORT elif num_occurrences == 1: self._host, self._port = connection_string.split(':') self._port = int(self._port) else: raise Exception("Invalid connection string {}".format(connection_string)) QueuedLineSender.__init__(self)
def __init__(self, com_port, com_options={}): self.com_port = com_port self.com_options = com_options QueuedLineSender.__init__(self)