1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +00:00

Hopefully fixed Kindle detection anomalies

This commit is contained in:
Paweł Jastrzębski
2015-11-04 20:42:48 +01:00
parent b2e58127cb
commit df0bafe4b6

View File

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