summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
diff options
context:
space:
mode:
authorJosh Morman <jmorman@gnuradio.org>2021-11-24 12:53:58 -0500
committermormj <34754695+mormj@users.noreply.github.com>2021-11-24 14:41:53 -0500
commit51ec89501552c35b2bd0721c0501302f224fe44d (patch)
tree442036c424c286ece0976dcd3c36891cddefcd25 /gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
parente426b9ad20dbbf41326c103b31a7418a80362b06 (diff)
runtime: pep8 formatting
Signed-off-by: Josh Morman <jmorman@gnuradio.org>
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/ctrlport/monitor.py')
-rw-r--r--gnuradio-runtime/python/gnuradio/ctrlport/monitor.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py b/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
index 1310d9a28b..58af134004 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/monitor.py
@@ -9,29 +9,38 @@
#
-import sys, subprocess, re, signal, time, atexit, os
+import sys
+import subprocess
+import re
+import signal
+import time
+import atexit
+import os
from gnuradio import gr
+
class monitor(object):
- def __init__(self,tool="gr-ctrlport-monitor"):
+ def __init__(self, tool="gr-ctrlport-monitor"):
print("ControlPort Monitor running.")
self.started = False
self.tool = tool
atexit.register(self.shutdown)
# setup export prefs
- gr.prefs().singleton().set_bool("ControlPort","on",True)
- gr.prefs().singleton().set_bool("PerfCounters","on",True)
- gr.prefs().singleton().set_bool("PerfCounters","export",True)
+ gr.prefs().singleton().set_bool("ControlPort", "on", True)
+ gr.prefs().singleton().set_bool("PerfCounters", "on", True)
+ gr.prefs().singleton().set_bool("PerfCounters", "export", True)
if(tool == "gr-perf-monitorx"):
- gr.prefs().singleton().set_bool("ControlPort","edges_list",True)
+ gr.prefs().singleton().set_bool("ControlPort", "edges_list", True)
def start(self):
try:
- print("monitor::endpoints() = %s" % (gr.rpcmanager_get().endpoints()))
+ print("monitor::endpoints() = %s" %
+ (gr.rpcmanager_get().endpoints()))
ep = gr.rpcmanager_get().endpoints()[0]
- cmd = [self.tool, re.search(r"-h (\S+|\d+\.\d+\.\d+\.\d+)", ep).group(1), re.search(r"-p (\d+)", ep).group(1)]
- print("running: %s"%(str(cmd)))
+ cmd = [self.tool, re.search(
+ r"-h (\S+|\d+\.\d+\.\d+\.\d+)", ep).group(1), re.search(r"-p (\d+)", ep).group(1)]
+ print("running: %s" % (str(cmd)))
self.proc = subprocess.Popen(cmd)
self.started = True
except: