mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2024-12-23 07:03:44 +00:00
tools/b43-tools/b43-fwsquash: convert to Python 3 with 2-to-3
Let's convert the script to Python 3. Signed-off-by: Petr Štetiar <ynezz@true.cz>
This commit is contained in:
parent
e9216b3336
commit
5989a75cc4
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# b43 firmware file squasher
|
# b43 firmware file squasher
|
||||||
# Removes unnecessary firmware files
|
# Removes unnecessary firmware files
|
||||||
@ -37,7 +37,7 @@ fwpath = sys.argv[3]
|
|||||||
|
|
||||||
phytypes = phytypes.split(',')
|
phytypes = phytypes.split(',')
|
||||||
try:
|
try:
|
||||||
corerevs = map(lambda r: int(r), corerevs.split(','))
|
corerevs = [int(r) for r in corerevs.split(',')]
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print("ERROR: \"%s\" is not a valid COREREVS string\n" % corerevs)
|
print("ERROR: \"%s\" is not a valid COREREVS string\n" % corerevs)
|
||||||
usage()
|
usage()
|
||||||
@ -45,7 +45,7 @@ except ValueError:
|
|||||||
|
|
||||||
|
|
||||||
fwfiles = os.listdir(fwpath)
|
fwfiles = os.listdir(fwpath)
|
||||||
fwfiles = filter(lambda str: str.endswith(".fw"), fwfiles)
|
fwfiles = [str for str in fwfiles if str.endswith(".fw")]
|
||||||
if not fwfiles:
|
if not fwfiles:
|
||||||
print("ERROR: No firmware files found in %s" % fwpath)
|
print("ERROR: No firmware files found in %s" % fwpath)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user