Disable libusb/libmtp on OS X

This commit is contained in:
Kovid Goyal 2012-09-02 19:38:46 +05:30
parent ae73428839
commit e6af33d5e9
2 changed files with 11 additions and 2 deletions

View File

@ -27,7 +27,8 @@ def fingerprint(d):
class MTP_DEVICE(MTPDeviceBase):
supported_platforms = ['linux', 'osx']
# libusb(x) does not work on OS X. So no MTP support for OS X
supported_platforms = ['linux']
def __init__(self, *args, **kwargs):
MTPDeviceBase.__init__(self, *args, **kwargs)

View File

@ -292,7 +292,15 @@ if islinux:
libusb_scanner = LibUSBScanner()
if isosx:
osx_scanner = libusb_scanner
# Apparently libusb causes mem leaks on some Macs and hangs on others and
# works on a few. OS X users will just have to live without MTP support.
# See https://bugs.launchpad.net/calibre/+bug/1044706
# See https://bugs.launchpad.net/calibre/+bug/1044758
# osx_scanner = libusb_scanner
usbobserver, usbobserver_err = plugins['usbobserver']
if usbobserver is None:
raise RuntimeError('Failed to load usbobserver: %s'%usbobserver_err)
osx_scanner = usbobserver.get_usb_devices
if isfreebsd:
freebsd_scanner = FreeBSDScanner()