mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Merge minor changes to apple driver from Greg's branch
This commit is contained in:
commit
b0220833ba
@ -7,9 +7,10 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
import cStringIO, ctypes, datetime, os, platform, re, shutil, sys, tempfile, time
|
import cStringIO, ctypes, datetime, os, platform, re, shutil, sys, tempfile, time
|
||||||
|
|
||||||
from calibre.constants import __appname__, __version__, DEBUG, cache_dir
|
|
||||||
from calibre import fit_image, confirm_config_name, strftime as _strftime
|
from calibre import fit_image, confirm_config_name, strftime as _strftime
|
||||||
from calibre.constants import isosx, iswindows
|
from calibre.constants import (
|
||||||
|
__appname__, __version__, DEBUG as CALIBRE_DEBUG, isosx, iswindows,
|
||||||
|
cache_dir as _cache_dir)
|
||||||
from calibre.devices.errors import OpenFeedback, UserFeedback
|
from calibre.devices.errors import OpenFeedback, UserFeedback
|
||||||
from calibre.devices.usbms.deviceconfig import DeviceConfig
|
from calibre.devices.usbms.deviceconfig import DeviceConfig
|
||||||
from calibre.devices.interface import DevicePlugin
|
from calibre.devices.interface import DevicePlugin
|
||||||
@ -20,6 +21,8 @@ from calibre.utils.config import config_dir, dynamic, prefs
|
|||||||
from calibre.utils.date import now, parse_date
|
from calibre.utils.date import now, parse_date
|
||||||
from calibre.utils.zipfile import ZipFile
|
from calibre.utils.zipfile import ZipFile
|
||||||
|
|
||||||
|
# DEBUG = False
|
||||||
|
DEBUG = CALIBRE_DEBUG
|
||||||
|
|
||||||
def strftime(fmt='%Y/%m/%d %H:%M:%S', dt=None):
|
def strftime(fmt='%Y/%m/%d %H:%M:%S', dt=None):
|
||||||
|
|
||||||
@ -309,7 +312,7 @@ class ITUNES(DriverBase):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def cache_dir(self):
|
def cache_dir(self):
|
||||||
return os.path.join(cache_dir(), 'itunes')
|
return os.path.join(_cache_dir(), 'itunes')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def archive_path(self):
|
def archive_path(self):
|
||||||
@ -887,8 +890,9 @@ class ITUNES(DriverBase):
|
|||||||
logger().info(" %s" % self.UNSUPPORTED_DIRECT_CONNECT_MODE_MESSAGE)
|
logger().info(" %s" % self.UNSUPPORTED_DIRECT_CONNECT_MODE_MESSAGE)
|
||||||
|
|
||||||
# Log supported DEVICE_IDs and BCDs
|
# Log supported DEVICE_IDs and BCDs
|
||||||
logger().info(" BCD: %s" % ['0x%x' % x for x in sorted(self.BCD)])
|
if DEBUG:
|
||||||
logger().info(" PRODUCT_ID: %s" % ['0x%x' % x for x in sorted(self.PRODUCT_ID)])
|
logger().info(" BCD: %s" % ['0x%x' % x for x in sorted(self.BCD)])
|
||||||
|
logger().info(" PRODUCT_ID: %s" % ['0x%x' % x for x in sorted(self.PRODUCT_ID)])
|
||||||
|
|
||||||
# Confirm/create thumbs archive
|
# Confirm/create thumbs archive
|
||||||
if not os.path.exists(self.cache_dir):
|
if not os.path.exists(self.cache_dir):
|
||||||
@ -1035,7 +1039,7 @@ class ITUNES(DriverBase):
|
|||||||
self.plugboard_func = pb_func
|
self.plugboard_func = pb_func
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
if DEBUG:
|
if False and DEBUG:
|
||||||
logger().info("%s.shutdown()\n" % self.__class__.__name__)
|
logger().info("%s.shutdown()\n" % self.__class__.__name__)
|
||||||
|
|
||||||
def sync_booklists(self, booklists, end_session=True):
|
def sync_booklists(self, booklists, end_session=True):
|
||||||
@ -1673,7 +1677,8 @@ class ITUNES(DriverBase):
|
|||||||
except:
|
except:
|
||||||
self.manual_sync_mode = False
|
self.manual_sync_mode = False
|
||||||
|
|
||||||
logger().info(" iTunes.manual_sync_mode: %s" % self.manual_sync_mode)
|
if DEBUG:
|
||||||
|
logger().info(" iTunes.manual_sync_mode: %s" % self.manual_sync_mode)
|
||||||
|
|
||||||
def _dump_booklist(self, booklist, header=None, indent=0):
|
def _dump_booklist(self, booklist, header=None, indent=0):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user