mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 12:24:00 +02:00
Better device detection on Windows
This commit is contained in:
parent
1dfba2c88c
commit
8b22f780b3
1 changed files with 2 additions and 1 deletions
|
|
@ -60,8 +60,9 @@ def test_bcd(self, bcdDevice, bcd):
|
|||
def is_device_connected(self, device):
|
||||
if iswindows:
|
||||
vid, pid = 'vid_%4.4x'%device.VENDOR_ID, 'pid_%4.4x'%device.PRODUCT_ID
|
||||
vidd, pidd = 'vid_%i'%device.VENDOR_ID, 'pid_%i'%device.PRODUCT_ID
|
||||
for device_id in self.devices:
|
||||
if vid in device_id and pid in device_id:
|
||||
if (vid in device_id or vidd in device_id) and (pid in device_id or pidd in device_id):
|
||||
if self.test_bcd_windows(device_id, getattr(device, 'BCD', None)):
|
||||
if device.can_handle(device_id):
|
||||
return True
|
||||
|
|
|
|||
Loading…
Reference in a new issue