mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ignore readonly drives exported by the device
This commit is contained in:
parent
c015a92e0c
commit
15b66c1f40
@ -248,14 +248,15 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
filtered = set()
|
filtered = set()
|
||||||
for dl in dlmap['drive_letters']:
|
for dl in dlmap['drive_letters']:
|
||||||
pnp_id = dlmap['pnp_id_map'][dl].upper()
|
pnp_id = dlmap['pnp_id_map'][dl].upper()
|
||||||
if self.windows_filter_pnp_id(pnp_id):
|
if dl in dlmap['readonly_drives']:
|
||||||
|
filtered.add(dl)
|
||||||
|
if debug:
|
||||||
|
prints('Ignoring the drive %s as it is readonly' % dl)
|
||||||
|
elif self.windows_filter_pnp_id(pnp_id):
|
||||||
filtered.add(dl)
|
filtered.add(dl)
|
||||||
if debug:
|
if debug:
|
||||||
prints('Ignoring the drive %s because of a PNP filter on %s' % (dl, pnp_id))
|
prints('Ignoring the drive %s because of a PNP filter on %s' % (dl, pnp_id))
|
||||||
dlmap['drive_letters'] = [dl for dl in dlmap['drive_letters'] if dl not in filtered]
|
elif not drive_is_ok(dl, debug=debug):
|
||||||
filtered = set()
|
|
||||||
for dl in dlmap['drive_letters']:
|
|
||||||
if not drive_is_ok(dl, debug=debug):
|
|
||||||
filtered.add(dl)
|
filtered.add(dl)
|
||||||
if debug:
|
if debug:
|
||||||
prints('Ignoring the drive %s because failed to get free space for it' % dl)
|
prints('Ignoring the drive %s because failed to get free space for it' % dl)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user