aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/examples/dpp-qrcode.py
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2019-01-24 07:45:42 (GMT)
committerJouni Malinen <j@w1.fi>2019-01-26 10:37:25 (GMT)
commit89896c0008d1e055790572190d02c24ae1721a76 (patch)
treedc6bc51984d101b49d0ac1092d04c4bf166481a9 /wpa_supplicant/examples/dpp-qrcode.py
parentbab493b90486b61c8feb2bc56d1769a08a75ab2a (diff)
downloadhostap-89896c0008d1e055790572190d02c24ae1721a76.zip
hostap-89896c0008d1e055790572190d02c24ae1721a76.tar.gz
hostap-89896c0008d1e055790572190d02c24ae1721a76.tar.bz2
tests: Use python3 compatible print statement
This patch is made by using 2to3 command. $ find . -name *.py | xargs 2to3 -f print -w -n Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Diffstat (limited to 'wpa_supplicant/examples/dpp-qrcode.py')
-rwxr-xr-xwpa_supplicant/examples/dpp-qrcode.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/wpa_supplicant/examples/dpp-qrcode.py b/wpa_supplicant/examples/dpp-qrcode.py
index f40f961..b468d15 100755
--- a/wpa_supplicant/examples/dpp-qrcode.py
+++ b/wpa_supplicant/examples/dpp-qrcode.py
@@ -25,11 +25,11 @@ def wpas_connect():
try:
ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)]
except OSError as error:
- print "Could not find wpa_supplicant: ", error
+ print("Could not find wpa_supplicant: ", error)
return None
if len(ifaces) < 1:
- print "No wpa_supplicant control interface found"
+ print("No wpa_supplicant control interface found")
return None
for ctrl in ifaces:
@@ -55,27 +55,27 @@ def dpp_logcat():
continue
if not uri.startswith('DPP:'):
continue
- print "Found DPP bootstrap info URI:"
- print uri
+ print("Found DPP bootstrap info URI:")
+ print(uri)
wpas = wpas_connect()
if not wpas:
- print "Could not connect to wpa_supplicant"
- print
+ print("Could not connect to wpa_supplicant")
+ print('')
continue
res = wpas.request("DPP_QR_CODE " + uri);
try:
id = int(res)
except ValueError:
- print "QR Code URI rejected"
+ print("QR Code URI rejected")
continue
- print "QR Code URI accepted - ID=%d" % id
- print wpas.request("DPP_BOOTSTRAP_INFO %d" % id)
+ print("QR Code URI accepted - ID=%d" % id)
+ print(wpas.request("DPP_BOOTSTRAP_INFO %d" % id))
del wpas
def dpp_display(curve):
wpas = wpas_connect()
if not wpas:
- print "Could not connect to wpa_supplicant"
+ print("Could not connect to wpa_supplicant")
return
res = wpas.request("STATUS")
addr = None
@@ -93,18 +93,18 @@ def dpp_display(curve):
try:
id = int(res)
except ValueError:
- print "Failed to generate bootstrap info URI"
+ print("Failed to generate bootstrap info URI")
return
- print "Bootstrap information - ID=%d" % id
- print wpas.request("DPP_BOOTSTRAP_INFO %d" % id)
+ print("Bootstrap information - ID=%d" % id)
+ print(wpas.request("DPP_BOOTSTRAP_INFO %d" % id))
uri = wpas.request("DPP_BOOTSTRAP_GET_URI %d" % id)
- print uri
- print "ID=%d" % id
+ print(uri)
+ print("ID=%d" % id)
qr = qrcode.QRCode(error_correction=qrcode.constants.ERROR_CORRECT_M,
border=3)
qr.add_data(uri, optimize=5)
qr.print_ascii(tty=True)
- print "ID=%d" % id
+ print("ID=%d" % id)
del wpas
def main():