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/GNURadioControlPortClient.py | |
parent | f9447f11df7ff3fe01959fc42f86ce509b152ac0 (diff) |
runtime: port ctrlport monitor to 3.8 and qt5
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py')
-rw-r--r-- | gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py b/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py index 8249d341ec..bee5cd15ed 100644 --- a/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py +++ b/gnuradio-runtime/python/gnuradio/ctrlport/GNURadioControlPortClient.py @@ -30,6 +30,8 @@ is currently the only supported transport. from __future__ import print_function from __future__ import unicode_literals +from argparse import ArgumentParser + from gnuradio.ctrlport.RPCConnection import RPCMethods try: from gnuradio.ctrlport.RPCConnectionThrift import RPCConnectionThrift @@ -113,18 +115,18 @@ class GNURadioControlPortClient(object): """ def __init__(self, argv = [], rpcmethod = 'thrift', callback = None, blockingcallback = None): - if len(argv) > 1: host = argv[1] - else: host = None - if len(argv) > 2: port = argv[2] - else: port = None + parser = ArgumentParser(description="GNU Radio Control Port Monitor") + parser.add_argument("host", nargs="?", default="localhost", help="host name or IP") + parser.add_argument("port", help="port") + args = parser.parse_args() self.client = None if rpcmethod in RPCMethods: if rpcmethod == 'thrift': #print("making RPCConnectionThrift") - self.client = RPCConnectionThrift(host, port) + self.client = RPCConnectionThrift(args.host, args.port) #print("made %s" % self.client) #print("making callback call") |