Группа :: Engineering
Пакет: uhd
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: uhd-4.3.0.0-python3-fix.patch
Скачать
Скачать
diff --git a/host/utils/latency/graph.py b/host/utils/latency/graph.py
index a675bc7cd..7b2afe128 100755
--- a/host/utils/latency/graph.py
+++ b/host/utils/latency/graph.py
@@ -116,7 +116,7 @@ def get_sorted_series(args, options):
if options.id is None:
options.id = x['id']
elif options.id != x['id']:
- print "Different IDs:", options.id, x['id']
+ print("Different IDs:", options.id, x['id'])
idx = line.find("-rate_")
if idx > -1:
idx += 6
@@ -143,13 +143,13 @@ def get_sorted_series(args, options):
if idx2 and (idx2.start() > 0):
idx2 = idx2.start()
x['suffix'] = line[::-1][len(line) - idx:][0:idx2][::-1]
- print x
+ print(x)
series += [x]
sort_keys = options.sort.split()
- print sort_keys
+ print(sort_keys)
sorted_key_list = _sort(series, sort_keys)
- print sorted_key_list
+ print(sorted_key_list)
series = _order(series, sorted_key_list)
return series
@@ -175,7 +175,7 @@ def main():
# Get all the wanted properties for this plot
plt_props = get_plt_props(options)
- print plt_props
+ print(plt_props)
mpl_plot(data, plt_props)
@@ -218,7 +218,7 @@ def get_data_diff(data):
if len(data) < 2:
return data[0] # Single data set. Can't calculate a diff.
- print "diff %d: rate %s, spb %s, spp %s" % (len(data), data[0]['metadata']['rate'], data[0]['metadata']['spb'], data[0]['metadata']['spp'])
+ print("diff %d: rate %s, spb %s, spp %s" % (len(data), data[0]['metadata']['rate'], data[0]['metadata']['spb'], data[0]['metadata']['spp']))
data = align_data(data)
@@ -266,7 +266,7 @@ def calculate_data_diff(data):
spps = find_values(data, "spp")
spbs = find_values(data, "spb")
rates = find_values(data, "rate")
- print spps, "\t", spbs, "\t", rates
+ print(spps, "\t", spbs, "\t", rates)
result = []
for rate in rates:
rd = find_match(data, "rate", rate)
diff --git a/host/utils/latency/pci_hwdata.py b/host/utils/latency/pci_hwdata.py
index a0f969caa..51abfc814 100755
--- a/host/utils/latency/pci_hwdata.py
+++ b/host/utils/latency/pci_hwdata.py
@@ -17,7 +17,7 @@ from optparse import OptionParser
try:
from gnuradio import uhd
except:
- print "Can't gather USRP info! gr-uhd not found."
+ print("Can't gather USRP info! gr-uhd not found.")
# If other paths for this file are known, add them to this list.
pci_hwdata_paths = ["/usr/share/hwdata/pci.ids", "/usr/share/misc/pci.ids"]
@@ -32,22 +32,22 @@ def main():
eths_ids = get_eths_with_ids()
for eth in eths_ids:
- print eth
+ print(eth)
save_eth_ids_info_to_file(eths_ids, options.file)
usrps = []
try:
usrps = get_usrps_with_device_info()
for usrp in usrps:
- print usrp
+ print(usrp)
except Exception as e:
- print "Can't gather USRP info!"
- print e.message,
+ print("Can't gather USRP info!")
+ print(e.message,)
try:
save_usrp_info(usrps, options.file)
except Exception as e:
- print "Can't save USRP info!"
- print e.message
+ print("Can't save USRP info!")
+ print(e.message)
def get_eths_with_ids():
@@ -74,7 +74,7 @@ def get_eth_interface_with_address():
for ip, mac in zip(ips, macs):
eths.append({'interface': iface, 'addr': ip['addr'], 'mac': mac['addr']})
if not eths:
- print "Can't gather Ethernet info. Check if a network based USRP is connected to host and responding to \'uhd_find_devices\'"
+ print("Can't gather Ethernet info. Check if a network based USRP is connected to host and responding to \'uhd_find_devices\'")
return eths
@@ -97,11 +97,11 @@ def get_usrps_with_device_info():
def save_usrp_info(usrps, filename):
if not usrps:
- print "No USRP data available. Not saving any data."
+ print("No USRP data available. Not saving any data.")
return
with open(filename, 'w') as f:
if f.closed:
- print "Warning: Couldn't open", filename, "to save results."
+ print("Warning: Couldn't open", filename, "to save results.")
f.write("#\n")
f.write("#\n")
f.write("# This file contains gathered information about USRPs connected to the host\n")
@@ -129,7 +129,7 @@ def save_usrp_info(usrps, filename):
def save_eth_ids_info_to_file(eths, filename):
with open(filename, 'w') as f:
if f.closed:
- print "Warning: Couldn't open", filename, "to save results."
+ print("Warning: Couldn't open", filename, "to save results.")
f.write("#\n")
f.write("#\n")
f.write("# This file contains infos about the available eth interfaces\n")
@@ -159,7 +159,7 @@ def get_id(path):
gid = 0
with open(path, 'r') as f:
if f.closed:
- print "Warning: Couldn't open", path, "to gather device information."
+ print("Warning: Couldn't open", path, "to gather device information.")
data = f.read()
gid = data[0:-1]
return gid
@@ -191,13 +191,13 @@ def get_vendors():
path = pci_path
break
if path == "":
- print "Couldn't find pci.ids file. Vendor data not available!"
+ print("Couldn't find pci.ids file. Vendor data not available!")
return vendors
vendor_id = ''
with open(path, 'r') as f:
if f.closed:
- print "Warning: Couldn't open", path, ". Vendor data not available."
+ print("Warning: Couldn't open", path, ". Vendor data not available.")
for line in f.readlines():
if line.startswith("#"):
if line.startswith("# List of known device classes"):
diff --git a/host/utils/latency/run_tests.py b/host/utils/latency/run_tests.py
index e3056964d..32e503af6 100755
--- a/host/utils/latency/run_tests.py
+++ b/host/utils/latency/run_tests.py
@@ -41,7 +41,7 @@ def launch_test(args="", rate=None, spb=None, spp=0, prefix="", suffix="", extra
if title is not None and len(title) > 0:
responder += ["--title=\"" + title + "\""]
if verbose:
- print "==> Executing:", " ".join(responder)
+ print("==> Executing:", " ".join(responder))
try:
responder += ["--log-file"] # This will produce another output file with logs
responder += ["--combine-eob"]
@@ -49,7 +49,7 @@ def launch_test(args="", rate=None, spb=None, spp=0, prefix="", suffix="", extra
res = p.wait() # make sure subprocess finishes
except KeyboardInterrupt:
res = p.wait() # even in CTRL+C case wait till subprocess finishes
- print "==> Caught CTRL+C"
+ print("==> Caught CTRL+C")
return None
return res
@@ -139,18 +139,18 @@ def get_extra_args(options, args):
extra = map(lambda x: _format_arg(extra_args, x), extra_args)
- print "\n".join(map(lambda x: str(x) + " = " + str(extra_args[x]), extra_args.keys()))
+ print("\n".join(map(lambda x: str(x) + " = " + str(extra_args[x]), extra_args.keys())))
return extra
def wait_for_keyboard():
try:
- print "\nPress ENTER to start..."
+ print("\nPress ENTER to start...")
raw_input()
return ReturnCode.RETCODE_OK
except KeyboardInterrupt:
- print "Aborted"
+ print("Aborted")
return ReturnCode.RETCODE_MANUAL_ABORT
@@ -182,7 +182,7 @@ def main():
for spp in spps:
if count > 0:
if options.pause:
- print "Press ENTER to begin next test..."
+ print("Press ENTER to begin next test...")
raw_input()
elif options.wait > 0:
time.sleep(options.wait)
@@ -207,8 +207,8 @@ def main():
results_spbs = results_rates[spb]
for spp in results_spbs.keys():
res = results_spbs[spp]
- print res, ":", rate, spb, spp
- print "Tests finished"
+ print(res, ":", rate, spb, spp)
+ print("Tests finished")
return 0