mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
6e02c4a32d
commit
01204cce5f
@ -513,6 +513,8 @@ def get_drive_letters_for_device(vendor_id, product_id, debug=False):
|
|||||||
found_at = i - 1
|
found_at = i - 1
|
||||||
break
|
break
|
||||||
if found_at is None:
|
if found_at is None:
|
||||||
|
if debug:
|
||||||
|
print('Could not find device matching vid=0x%x pid=0x%x: %r' % (vendor_id, product_id))
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
# Get the device ids for all descendants of the found device
|
# Get the device ids for all descendants of the found device
|
||||||
@ -521,7 +523,7 @@ def get_drive_letters_for_device(vendor_id, product_id, debug=False):
|
|||||||
devid, wbuf = get_device_id(devinst, buf=wbuf)
|
devid, wbuf = get_device_id(devinst, buf=wbuf)
|
||||||
device_ids.add(devid.upper().replace(os.sep, '#'))
|
device_ids.add(devid.upper().replace(os.sep, '#'))
|
||||||
if debug:
|
if debug:
|
||||||
print('Device ids: %r' % device_ids)
|
print('Device ids for vid=0x%x pid=0x%x: %r' % (vendor_id, product_id, device_ids))
|
||||||
if not device_ids:
|
if not device_ids:
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
@ -546,6 +548,8 @@ def get_drive_letters_for_device(vendor_id, product_id, debug=False):
|
|||||||
if q in devpath:
|
if q in devpath:
|
||||||
matched = True
|
matched = True
|
||||||
break
|
break
|
||||||
|
if debug:
|
||||||
|
print('Found volume with device path: %s Matches a device_id: %s' % (devpath, matched))
|
||||||
if matched:
|
if matched:
|
||||||
drive_letter = drive_letter_from_volume_devpath(devpath, drive_map)
|
drive_letter = drive_letter_from_volume_devpath(devpath, drive_map)
|
||||||
if drive_letter:
|
if drive_letter:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user