mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sync to trunk.
This commit is contained in:
commit
d6d268b92a
@ -9,6 +9,7 @@ from calibre.devices.usbms.driver import USBMS
|
|||||||
class ANDROID(USBMS):
|
class ANDROID(USBMS):
|
||||||
|
|
||||||
name = 'Android driver'
|
name = 'Android driver'
|
||||||
|
gui_name = 'Android phone'
|
||||||
description = _('Communicate with Android phones.')
|
description = _('Communicate with Android phones.')
|
||||||
author = 'Kovid Goyal'
|
author = 'Kovid Goyal'
|
||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
|
@ -15,6 +15,7 @@ from calibre.devices.usbms.driver import USBMS
|
|||||||
class BEBOOK(USBMS):
|
class BEBOOK(USBMS):
|
||||||
|
|
||||||
name = 'BeBook driver'
|
name = 'BeBook driver'
|
||||||
|
gui_name = 'BeBook'
|
||||||
description = _('Communicate with the BeBook eBook reader.')
|
description = _('Communicate with the BeBook eBook reader.')
|
||||||
author = 'Tijmen Ruizendaal'
|
author = 'Tijmen Ruizendaal'
|
||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
@ -90,6 +91,7 @@ class BEBOOK(USBMS):
|
|||||||
|
|
||||||
class BEBOOK_MINI(BEBOOK):
|
class BEBOOK_MINI(BEBOOK):
|
||||||
name = 'BeBook Mini driver'
|
name = 'BeBook Mini driver'
|
||||||
|
gui_name = 'BeBook Mini'
|
||||||
description = _('Communicate with the BeBook Mini eBook reader.')
|
description = _('Communicate with the BeBook Mini eBook reader.')
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ import calibre.devices.cybookg3.t2b as t2b
|
|||||||
class CYBOOKG3(USBMS):
|
class CYBOOKG3(USBMS):
|
||||||
|
|
||||||
name = 'Cybook Gen 3 Device Interface'
|
name = 'Cybook Gen 3 Device Interface'
|
||||||
|
gui_name = 'Cybook Gen 3'
|
||||||
description = _('Communicate with the Cybook Gen 3 eBook reader.')
|
description = _('Communicate with the Cybook Gen 3 eBook reader.')
|
||||||
author = _('John Schember')
|
author = _('John Schember')
|
||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
@ -81,6 +82,7 @@ class CYBOOKG3(USBMS):
|
|||||||
class CYBOOK_OPUS(USBMS):
|
class CYBOOK_OPUS(USBMS):
|
||||||
|
|
||||||
name = 'Cybook Opus Device Interface'
|
name = 'Cybook Opus Device Interface'
|
||||||
|
gui_name = 'Cybook Opus'
|
||||||
description = _('Communicate with the Cybook Opus eBook reader.')
|
description = _('Communicate with the Cybook Opus eBook reader.')
|
||||||
author = _('John Schember')
|
author = _('John Schember')
|
||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
|
@ -24,8 +24,10 @@ try:
|
|||||||
_libusb = load_library(_libusb_name, cdll)
|
_libusb = load_library(_libusb_name, cdll)
|
||||||
except OSError:
|
except OSError:
|
||||||
_libusb = cdll.LoadLibrary('libusb-0.1.so.4')
|
_libusb = cdll.LoadLibrary('libusb-0.1.so.4')
|
||||||
|
has_library = True
|
||||||
except:
|
except:
|
||||||
_libusb = None
|
_libusb = None
|
||||||
|
has_library = False
|
||||||
|
|
||||||
class DeviceDescriptor(Structure):
|
class DeviceDescriptor(Structure):
|
||||||
_fields_ = [\
|
_fields_ = [\
|
||||||
|
@ -8,6 +8,7 @@ manner.
|
|||||||
import sys, re, os
|
import sys, re, os
|
||||||
|
|
||||||
from calibre import iswindows, isosx, plugins
|
from calibre import iswindows, isosx, plugins
|
||||||
|
from calibre.devices import libusb
|
||||||
|
|
||||||
osx_scanner = win_scanner = linux_scanner = None
|
osx_scanner = win_scanner = linux_scanner = None
|
||||||
|
|
||||||
@ -22,11 +23,12 @@ elif isosx:
|
|||||||
except:
|
except:
|
||||||
raise RuntimeError('Failed to load the usbobserver plugin: %s'%plugins['usbobserver'][1])
|
raise RuntimeError('Failed to load the usbobserver plugin: %s'%plugins['usbobserver'][1])
|
||||||
|
|
||||||
|
|
||||||
_usb_re = re.compile(r'Vendor\s*=\s*([0-9a-fA-F]+)\s+ProdID\s*=\s*([0-9a-fA-F]+)\s+Rev\s*=\s*([0-9a-fA-f.]+)')
|
_usb_re = re.compile(r'Vendor\s*=\s*([0-9a-fA-F]+)\s+ProdID\s*=\s*([0-9a-fA-F]+)\s+Rev\s*=\s*([0-9a-fA-f.]+)')
|
||||||
_DEVICES = '/proc/bus/usb/devices'
|
_DEVICES = '/proc/bus/usb/devices'
|
||||||
|
|
||||||
|
|
||||||
def linux_scanner():
|
def _linux_scanner():
|
||||||
raw = open(_DEVICES).read()
|
raw = open(_DEVICES).read()
|
||||||
devices = []
|
devices = []
|
||||||
device = None
|
device = None
|
||||||
@ -46,6 +48,11 @@ def linux_scanner():
|
|||||||
devices.append(device)
|
devices.append(device)
|
||||||
return devices
|
return devices
|
||||||
|
|
||||||
|
if libusb.has_library:
|
||||||
|
linux_scanner = libusb.get_devices
|
||||||
|
else:
|
||||||
|
linux_scanner = _linux_scanner
|
||||||
|
|
||||||
class DeviceScanner(object):
|
class DeviceScanner(object):
|
||||||
|
|
||||||
def __init__(self, *args):
|
def __init__(self, *args):
|
||||||
|
@ -1421,15 +1421,16 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
|||||||
for row in rows:
|
for row in rows:
|
||||||
row = row.row()
|
row = row.row()
|
||||||
|
|
||||||
formats = self.library_view.model().db.formats(row).upper()
|
formats = self.library_view.model().db.formats(row)
|
||||||
formats = formats.split(',')
|
|
||||||
title = self.library_view.model().db.title(row)
|
title = self.library_view.model().db.title(row)
|
||||||
|
|
||||||
if not formats:
|
if not formats:
|
||||||
error_dialog(self, _('Cannot view'),
|
error_dialog(self, _('Cannot view'),
|
||||||
_('%s has no available formats.')%(title,), show=True)
|
_('%s has no available formats.')%(title,), show=True)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
formats = formats.upper().split(',')
|
||||||
|
|
||||||
|
|
||||||
in_prefs = False
|
in_prefs = False
|
||||||
for format in prefs['input_format_order']:
|
for format in prefs['input_format_order']:
|
||||||
if format in formats:
|
if format in formats:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user