diff options
-rw-r--r-- | gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py | 11 | ||||
-rw-r--r-- | gr-dtv/examples/atsc_ctrlport_monitor.py | 6 |
2 files changed, 13 insertions, 4 deletions
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py b/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py index 8b811ab9d9..8249d341ec 100644 --- a/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py +++ b/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py @@ -30,6 +30,15 @@ is currently the only supported transport. from __future__ import print_function from __future__ import unicode_literals +from gnuradio.ctrlport.RPCConnection import RPCMethods +try: + from gnuradio.ctrlport.RPCConnectionThrift import RPCConnectionThrift + from thrift.transport.TTransport import TTransportException +except ImportError: + # Thrift support not provided we should remove it from RPCMethods + pass + + """ GNURadioControlPortClient is the main class for creating a GNU Radio ControlPort client application for all transports. @@ -112,9 +121,7 @@ class GNURadioControlPortClient(object): self.client = None - from gnuradio.ctrlport.RPCConnection import RPCMethods if rpcmethod in RPCMethods: - from gnuradio.ctrlport.RPCConnectionThrift import RPCConnectionThrift if rpcmethod == 'thrift': #print("making RPCConnectionThrift") self.client = RPCConnectionThrift(host, port) diff --git a/gr-dtv/examples/atsc_ctrlport_monitor.py b/gr-dtv/examples/atsc_ctrlport_monitor.py index 9f233d9ff5..ad7cf03718 100644 --- a/gr-dtv/examples/atsc_ctrlport_monitor.py +++ b/gr-dtv/examples/atsc_ctrlport_monitor.py @@ -27,7 +27,9 @@ import matplotlib matplotlib.use("QT4Agg") import matplotlib.pyplot as plt import matplotlib.animation as animation -from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient +from gnuradio.ctrlport.GNURadioControlPortClient import ( + GNURadioControlPortClient, TTransportException, +) import numpy from numpy.fft import fftpack @@ -106,7 +108,7 @@ class atsc_ctrlport_monitor(object): self._viterbi_metric.pop() self._viterbi_metric.insert(0, vt_decoder_metrics) - except: + except TTransportException: sys.stderr.write("Lost connection, exiting") sys.exit(1) |