From 64844f643efdb79058080ef581d532aeaa08d4b7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 19 Oct 2012 08:06:13 +0530 Subject: [PATCH] Driver for WayteQ xBook. Fixes #1066083 (WayteQ xBook-60w driver) --- src/calibre/customize/builtins.py | 4 +- src/calibre/devices/android/driver.py | 2 +- src/calibre/devices/misc.py | 55 +++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index f435aafefe..e665f31b2e 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -668,7 +668,7 @@ from calibre.devices.teclast.driver import (TECLAST_K3, NEWSMY, IPAPYRUS, from calibre.devices.sne.driver import SNE from calibre.devices.misc import (PALMPRE, AVANT, SWEEX, PDNOVEL, GEMEI, VELOCITYMICRO, PDNOVEL_KOBO, LUMIREAD, ALURATEK_COLOR, - TREKSTOR, EEEREADER, NEXTBOOK, ADAM, MOOVYBOOK, COBY, EX124G) + TREKSTOR, EEEREADER, NEXTBOOK, ADAM, MOOVYBOOK, COBY, EX124G, WAYTEQ) from calibre.devices.folder_device.driver import FOLDER_DEVICE_FOR_CONFIG from calibre.devices.kobo.driver import KOBO, KOBOTOUCH from calibre.devices.bambook.driver import BAMBOOK @@ -742,7 +742,7 @@ plugins += [ EEEREADER, NEXTBOOK, ADAM, - MOOVYBOOK, COBY, EX124G, + MOOVYBOOK, COBY, EX124G, WAYTEQ, ITUNES, BOEYE_BEX, BOEYE_BDX, diff --git a/src/calibre/devices/android/driver.py b/src/calibre/devices/android/driver.py index 60d78ab105..6159d1b065 100644 --- a/src/calibre/devices/android/driver.py +++ b/src/calibre/devices/android/driver.py @@ -168,7 +168,7 @@ class ANDROID(USBMS): # Xperia 0x13d3 : { 0x3304 : [0x0001, 0x0002] }, - # CREEL?? Also Nextbook + # CREEL?? Also Nextbook and Wayteq 0x5e3 : { 0x726 : [0x222] }, # ZTE diff --git a/src/calibre/devices/misc.py b/src/calibre/devices/misc.py index 2565c24218..18cc1c232d 100644 --- a/src/calibre/devices/misc.py +++ b/src/calibre/devices/misc.py @@ -407,4 +407,59 @@ class EX124G(USBMS): return 'eBooks' return self.EBOOK_DIR_CARD_A +class WAYTEQ(USBMS): + + name = 'WayteQ device interface' + gui_name = 'WayteQ xBook' + description = _('Communicate with the WayteQ Reader') + author = 'Kovid Goyal' + supported_platforms = ['windows', 'osx', 'linux'] + + # Ordered list of supported formats + FORMATS = ['epub', 'mobi', 'prc', 'fb2', 'txt', 'pdf', 'html', 'rtf', 'chm', 'djvu', 'doc'] + + VENDOR_ID = [0x05e3] + PRODUCT_ID = [0x0726] + BCD = [0x0222] + + EBOOK_DIR_MAIN = 'Documents' + SCAN_FROM_ROOT = True + + VENDOR_NAME = 'ROCKCHIP' + WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = 'RK28_SDK_DEMO' + SUPPORTS_SUB_DIRS = True + + def get_carda_ebook_dir(self, for_upload=False): + if for_upload: + return 'Documents' + return self.EBOOK_DIR_CARD_A + + def windows_sort_drives(self, drives): + if len(drives) < 2: return drives + main = drives.get('main', None) + carda = drives.get('carda', None) + if main and carda: + drives['main'] = carda + drives['carda'] = main + return drives + + def linux_swap_drives(self, drives): + if len(drives) < 2 or not drives[1] or not drives[2]: return drives + drives = list(drives) + t = drives[0] + drives[0] = drives[1] + drives[1] = t + return tuple(drives) + + def osx_sort_names(self, names): + if len(names) < 2: return names + main = names.get('main', None) + card = names.get('carda', None) + + if main is not None and card is not None: + names['main'] = card + names['carda'] = main + + return names +