Sort disks and partitions numerically

This commit is contained in:
CorpNewt 2019-10-19 15:25:15 -05:00 committed by GitHub
parent 2fd15e1319
commit cfe17c0228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -605,7 +605,7 @@ class WinUSB:
print("!WARNING! Unknown disk types. Be ABSOLUTELY sure")
print("!WARNING! before selecting a disk!")
print("")
for disk in sorted(rem_disks):
for disk in sorted(rem_disks,key=lambda x:int(x)):
print("{}. {} - {} ({})".format(
disk,
rem_disks[disk].get("model","Unknown"),
@ -616,7 +616,7 @@ class WinUSB:
print(" No Mounted Partitions")
else:
parts = rem_disks[disk]["partitions"]
for p in sorted(parts):
for p in sorted(parts,key=lambda x:int(x)):
print(" {}. {} ({}) {} - {}".format(
p,
parts[p].get("letter","No Letter"),