mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Merge pull request #109 from cbhaley/master
Send the first few NOOPs more quickly. Apparently one can get lost, ...
This commit is contained in:
commit
b61d14c8e1
1 changed files with 3 additions and 2 deletions
|
|
@ -845,8 +845,9 @@ def is_usb_connected(self, devices_on_system, debug=False, only_presence=False):
|
|||
self.is_connected = False
|
||||
if self.is_connected:
|
||||
self.noop_counter += 1
|
||||
if only_presence and (
|
||||
self.noop_counter % self.SEND_NOOP_EVERY_NTH_PROBE) != 1:
|
||||
if (only_presence and
|
||||
self.noop_counter > self.SEND_NOOP_EVERY_NTH_PROBE and
|
||||
(self.noop_counter % self.SEND_NOOP_EVERY_NTH_PROBE) != 1):
|
||||
try:
|
||||
ans = select.select((self.device_socket,), (), (), 0)
|
||||
if len(ans[0]) == 0:
|
||||
|
|
|
|||
Loading…
Reference in a new issue