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):
|
||||
|
||||
name = 'Android driver'
|
||||
gui_name = 'Android phone'
|
||||
description = _('Communicate with Android phones.')
|
||||
author = 'Kovid Goyal'
|
||||
supported_platforms = ['windows', 'osx', 'linux']
|
||||
|
@ -15,6 +15,7 @@ from calibre.devices.usbms.driver import USBMS
|
||||
class BEBOOK(USBMS):
|
||||
|
||||
name = 'BeBook driver'
|
||||
gui_name = 'BeBook'
|
||||
description = _('Communicate with the BeBook eBook reader.')
|
||||
author = 'Tijmen Ruizendaal'
|
||||
supported_platforms = ['windows', 'osx', 'linux']
|
||||
@ -90,6 +91,7 @@ class BEBOOK(USBMS):
|
||||
|
||||
class BEBOOK_MINI(BEBOOK):
|
||||
name = 'BeBook Mini driver'
|
||||
gui_name = 'BeBook Mini'
|
||||
description = _('Communicate with the BeBook Mini eBook reader.')
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@ import calibre.devices.cybookg3.t2b as t2b
|
||||
class CYBOOKG3(USBMS):
|
||||
|
||||
name = 'Cybook Gen 3 Device Interface'
|
||||
gui_name = 'Cybook Gen 3'
|
||||
description = _('Communicate with the Cybook Gen 3 eBook reader.')
|
||||
author = _('John Schember')
|
||||
supported_platforms = ['windows', 'osx', 'linux']
|
||||
@ -81,6 +82,7 @@ class CYBOOKG3(USBMS):
|
||||
class CYBOOK_OPUS(USBMS):
|
||||
|
||||
name = 'Cybook Opus Device Interface'
|
||||
gui_name = 'Cybook Opus'
|
||||
description = _('Communicate with the Cybook Opus eBook reader.')
|
||||
author = _('John Schember')
|
||||
supported_platforms = ['windows', 'osx', 'linux']
|
||||
|
@ -24,8 +24,10 @@ try:
|
||||
_libusb = load_library(_libusb_name, cdll)
|
||||
except OSError:
|
||||
_libusb = cdll.LoadLibrary('libusb-0.1.so.4')
|
||||
has_library = True
|
||||
except:
|
||||
_libusb = None
|
||||
has_library = False
|
||||
|
||||
class DeviceDescriptor(Structure):
|
||||
_fields_ = [\
|
||||
|
@ -8,6 +8,7 @@ manner.
|
||||
import sys, re, os
|
||||
|
||||
from calibre import iswindows, isosx, plugins
|
||||
from calibre.devices import libusb
|
||||
|
||||
osx_scanner = win_scanner = linux_scanner = None
|
||||
|
||||
@ -22,11 +23,12 @@ elif isosx:
|
||||
except:
|
||||
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.]+)')
|
||||
_DEVICES = '/proc/bus/usb/devices'
|
||||
|
||||
|
||||
def linux_scanner():
|
||||
def _linux_scanner():
|
||||
raw = open(_DEVICES).read()
|
||||
devices = []
|
||||
device = None
|
||||
@ -46,6 +48,11 @@ def linux_scanner():
|
||||
devices.append(device)
|
||||
return devices
|
||||
|
||||
if libusb.has_library:
|
||||
linux_scanner = libusb.get_devices
|
||||
else:
|
||||
linux_scanner = _linux_scanner
|
||||
|
||||
class DeviceScanner(object):
|
||||
|
||||
def __init__(self, *args):
|
||||
|
@ -1421,15 +1421,16 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
||||
for row in rows:
|
||||
row = row.row()
|
||||
|
||||
formats = self.library_view.model().db.formats(row).upper()
|
||||
formats = formats.split(',')
|
||||
formats = self.library_view.model().db.formats(row)
|
||||
title = self.library_view.model().db.title(row)
|
||||
|
||||
if not formats:
|
||||
error_dialog(self, _('Cannot view'),
|
||||
_('%s has no available formats.')%(title,), show=True)
|
||||
continue
|
||||
|
||||
formats = formats.upper().split(',')
|
||||
|
||||
|
||||
in_prefs = False
|
||||
for format in prefs['input_format_order']:
|
||||
if format in formats:
|
||||
|
Loading…
x
Reference in New Issue
Block a user