diff options
author | Bastian Bloessl <mail@bastibl.net> | 2019-06-16 11:05:51 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-06-19 13:00:00 -0700 |
commit | 3750f748501ec83d60c489dfa700522f3be21b00 (patch) | |
tree | 7b7695cbe292b278942f58d5179d665eb16d3a4c /gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py | |
parent | f9447f11df7ff3fe01959fc42f86ce509b152ac0 (diff) |
runtime: port ctrlport monitor to 3.8 and qt5
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py')
-rw-r--r-- | gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py b/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py index 466fc9fc04..3bc4c87308 100644 --- a/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py +++ b/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py @@ -41,10 +41,13 @@ class ThriftRadioClient(object): self.transport.open() def __del__(self): - self.radio.shutdown() - self.transport.close() + try: + self.transport.close() + self.radio.shutdown() + except: + pass - def getRadio(self, host, port): + def getRadio(self): return self.radio """ @@ -138,10 +141,10 @@ class RPCConnectionThrift(RPCConnection.RPCConnection): def newConnection(self, host=None, port=None): try: - self.thriftclient = ThriftRadioClient(self.getHost(), self.getPort()) - except TTransport.TTransportException: - sys.stderr.write("Could not connect to ControlPort endpoint at {0}:{1}.\n\n".format(host, port)) - sys.exit(1) + self.thriftclient = ThriftRadioClient(host, int(port)) + except: + return None + return self def properties(self, *args): knobprops = self.thriftclient.radio.properties(*args) |