1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-24 15:11:43 +00:00

add fat to list of drives

This commit is contained in:
Alex Xu
2023-12-05 11:12:10 -08:00
parent e79e5a311c
commit 983bde1691

View File

@@ -31,8 +31,7 @@ class Kindle:
def findDevice(self): def findDevice(self):
for drive in reversed(psutil.disk_partitions(False)): for drive in reversed(psutil.disk_partitions(False)):
if (drive[2] == 'FAT32' and drive[3] == 'rw,removable') or \ if (drive[2] == 'FAT32' and drive[3] == 'rw,removable') or \
(drive[2] == 'vfat' and 'rw' in drive[3]) or \ (drive[2] in ('vfat', 'msdos', 'FAT') and 'rw' in drive[3]):
(drive[2] == 'msdos' and 'rw' in drive[3]):
if os.path.isdir(os.path.join(drive[1], 'system')) and \ if os.path.isdir(os.path.join(drive[1], 'system')) and \
os.path.isdir(os.path.join(drive[1], 'documents')): os.path.isdir(os.path.join(drive[1], 'documents')):
return drive[1] return drive[1]