From 0722225484cf3cd72db9220285e63accd7310eee Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 5 Apr 2011 17:19:17 -0700 Subject: usrp2: ran 2to3 on python apps and make corrections for old imports to work --- host/utils/usrp2_recovery.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) mode change 100755 => 100644 host/utils/usrp2_recovery.py (limited to 'host/utils/usrp2_recovery.py') diff --git a/host/utils/usrp2_recovery.py b/host/utils/usrp2_recovery.py old mode 100755 new mode 100644 index 5654e93d3..c7578d3a0 --- 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") -- cgit v1.2.3 From cab1746e1c3582f8d44f2141cfcbb948aa6dd10c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 6 Apr 2011 08:01:40 -0700 Subject: usrp2: restore executable permission on python scripts --- host/utils/usrp2_card_burner.py | 0 host/utils/usrp2_card_burner_gui.py | 0 host/utils/usrp2_recovery.py | 0 host/utils/usrp_n2xx_net_burner.py | 0 host/utils/usrp_n2xx_net_burner_gui.py | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 host/utils/usrp2_card_burner.py mode change 100644 => 100755 host/utils/usrp2_card_burner_gui.py mode change 100644 => 100755 host/utils/usrp2_recovery.py mode change 100644 => 100755 host/utils/usrp_n2xx_net_burner.py mode change 100644 => 100755 host/utils/usrp_n2xx_net_burner_gui.py (limited to 'host/utils/usrp2_recovery.py') diff --git a/host/utils/usrp2_card_burner.py b/host/utils/usrp2_card_burner.py old mode 100644 new mode 100755 diff --git a/host/utils/usrp2_card_burner_gui.py b/host/utils/usrp2_card_burner_gui.py old mode 100644 new mode 100755 diff --git a/host/utils/usrp2_recovery.py b/host/utils/usrp2_recovery.py old mode 100644 new mode 100755 diff --git a/host/utils/usrp_n2xx_net_burner.py b/host/utils/usrp_n2xx_net_burner.py old mode 100644 new mode 100755 diff --git a/host/utils/usrp_n2xx_net_burner_gui.py b/host/utils/usrp_n2xx_net_burner_gui.py old mode 100644 new mode 100755 -- cgit v1.2.3