mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
1b63da86ff
@ -13,7 +13,6 @@ import datetime, os, re, sys, json, hashlib
|
||||
from calibre.devices.kindle.bookmark import Bookmark
|
||||
from calibre.devices.usbms.driver import USBMS
|
||||
from calibre import strftime
|
||||
from calibre.utils.logging import default_log
|
||||
|
||||
'''
|
||||
Notes on collections:
|
||||
@ -389,6 +388,7 @@ class KINDLE2(KINDLE):
|
||||
self.upload_apnx(path, filename, metadata, filepath)
|
||||
|
||||
def upload_kindle_thumbnail(self, metadata, filepath):
|
||||
from calibre.utils.logging import default_log
|
||||
coverdata = getattr(metadata, 'thumbnail', None)
|
||||
if not coverdata or not coverdata[2]:
|
||||
return
|
||||
|
@ -36,13 +36,9 @@ def synchronous(tlockname):
|
||||
|
||||
def _synched(func):
|
||||
@wraps(func)
|
||||
def _synchronizer(self,*args, **kwargs):
|
||||
tlock = self.__getattribute__( tlockname)
|
||||
tlock.acquire()
|
||||
try:
|
||||
def _synchronizer(self, *args, **kwargs):
|
||||
with self.__getattribute__(tlockname):
|
||||
return func(self, *args, **kwargs)
|
||||
finally:
|
||||
tlock.release()
|
||||
return _synchronizer
|
||||
return _synched
|
||||
|
||||
@ -466,12 +462,12 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin):
|
||||
ans = select.select((self.listen_socket,), (), (), 0)
|
||||
if len(ans[0]) > 0:
|
||||
# timeout in 10 ms to detect rare case where the socket went
|
||||
# way between the select and the accent
|
||||
# way between the select and the accept
|
||||
try:
|
||||
self.device_socket = None
|
||||
self.listen_socket.settimeout(0.010)
|
||||
self.device_socket, ign = \
|
||||
eintr_retry_call(self.listen_socket.accept)
|
||||
self.device_socket, ign = eintr_retry_call(
|
||||
self.listen_socket.accept)
|
||||
self.listen_socket.settimeout(None)
|
||||
self.device_socket.settimeout(None)
|
||||
self.is_connected = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user