aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/usrp2_recovery.py
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-04-05 17:19:17 -0700
committerJosh Blum <josh@joshknows.com>2011-04-05 17:19:17 -0700
commit0722225484cf3cd72db9220285e63accd7310eee (patch)
treeddeed7970120fe0688f676d9ef385dc4b799ba7f /host/utils/usrp2_recovery.py
parentaf2ab1c688d641e82060016aa772432de6445633 (diff)
downloaduhd-0722225484cf3cd72db9220285e63accd7310eee.tar.gz
uhd-0722225484cf3cd72db9220285e63accd7310eee.tar.bz2
uhd-0722225484cf3cd72db9220285e63accd7310eee.zip
usrp2: ran 2to3 on python apps and make corrections for old imports to work
Diffstat (limited to 'host/utils/usrp2_recovery.py')
-rw-r--r--[-rwxr-xr-x]host/utils/usrp2_recovery.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/host/utils/usrp2_recovery.py b/host/utils/usrp2_recovery.py
index 5654e93d3..c7578d3a0 100755..100644
--- a/host/utils/usrp2_recovery.py
+++ b/host/utils/usrp2_recovery.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2010 Ettus Research LLC
+# Copyright 2010-2011 Ettus Research LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@ RECOVERY_ETHERTYPE = 0xbeee
IP_RECOVERY_CODE = 'addr'
def mac_addr_repr_to_binary_string(mac_addr):
- return ''.join(map(lambda x: chr(int(x, 16)), mac_addr.split(':')))
+ return ''.join([chr(int(x, 16)) for x in mac_addr.split(':')])
if __name__ == '__main__':
parser = optparse.OptionParser(usage='usage: %prog [options]\n'+__doc__)
@@ -48,12 +48,12 @@ if __name__ == '__main__':
(options, args) = parser.parse_args()
#create the raw socket
- print "Opening raw socket on interface:", options.ifc
+ print("Opening raw socket on interface:", options.ifc)
soc = socket.socket(socket.PF_PACKET, socket.SOCK_RAW)
soc.bind((options.ifc, RECOVERY_ETHERTYPE))
#create the recovery packet
- print "Loading packet with ip address:", options.new_ip
+ print("Loading packet with ip address:", options.new_ip)
packet = struct.pack(
'!6s6sH4s4s',
mac_addr_repr_to_binary_string(BCAST_MAC_ADDR),
@@ -63,6 +63,6 @@ if __name__ == '__main__':
socket.inet_aton(options.new_ip),
)
- print "Sending packet (%d bytes)"%len(packet)
+ print("Sending packet (%d bytes)"%len(packet))
soc.send(packet)
- print "Done"
+ print("Done")