~martijnbraam/pyatem

8ba861109bad021344a8b20df310a11b94cda8af — Martijn Braam 2 months ago 793d8e5
openswitcher: fix port number storing in OpenSwitcher proxy mode

The portnumber did not get properly restored in the UI and errors
were hidden due to improper exception handleing
3 files changed, 14 insertions(+), 4 deletions(-)

M gtk_switcher/atemwindow.py
M gtk_switcher/connectionwindow.py
M pyatem/transport.py
M gtk_switcher/atemwindow.py => gtk_switcher/atemwindow.py +1 -1
@@ 51,7 51,7 @@ class AtemConnection(threading.Thread):
            try:
                self.mixer.loop()
            except Exception as e:
                traceback.print_stack()
                traceback.print_exc()
                print("EXCEPTION", repr(e))

    def do_callback(self, *args, **kwargs):

M gtk_switcher/connectionwindow.py => gtk_switcher/connectionwindow.py +11 -3
@@ 100,9 100,17 @@ class Handler:
                address = part.hostname
                if part.port:
                    address += ':' + str(part.port)
                self.ipaddress.set_text(part.hostname)
                self.username.set_text(part.username)
                self.password.set_text(part.password)
                self.ipaddress.set_text(address)

                if part.username is None:
                    self.username.set_text("")
                else:
                    self.username.set_text(part.username)

                if part.password is None:
                    self.password.set_text("")
                else:
                    self.password.set_text(part.password)
                self.device.set_text(part.path[1:])

                self.connection_tcp.set_active(True)

M pyatem/transport.py => pyatem/transport.py +2 -0
@@ 416,6 416,8 @@ class TcpProtocol:
        self._send_packet(self.list_to_packets([(b'*SW*', b'')]))

    def send_auth(self):
        if self.username is None or self.password is None:
            raise ValueError("Proxy requests AUTH but username or password is not set")
        self._send_packet(self.list_to_packets([
            (b'*USR', self.username.encode()),
            (b'*PWD', self.password.encode()),