diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index f6c11f9d30..5f3aab142e 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -476,7 +476,7 @@ from calibre.devices.teclast.driver import TECLAST_K3, NEWSMY, IPAPYRUS, \ SOVOS, PICO from calibre.devices.sne.driver import SNE from calibre.devices.misc import PALMPRE, AVANT, SWEEX, PDNOVEL, KOGAN, \ - GEMEI, VELOCITYMICRO, PDNOVEL_KOBO, Q600 + GEMEI, VELOCITYMICRO, PDNOVEL_KOBO, Q600, LUMIREAD from calibre.devices.folder_device.driver import FOLDER_DEVICE_FOR_CONFIG from calibre.devices.kobo.driver import KOBO @@ -600,6 +600,7 @@ plugins += [ GEMEI, VELOCITYMICRO, PDNOVEL_KOBO, + LUMIREAD, ITUNES, ] plugins += [x for x in list(locals().values()) if isinstance(x, type) and \ diff --git a/src/calibre/devices/misc.py b/src/calibre/devices/misc.py index d95c8e4036..e27aee4393 100644 --- a/src/calibre/devices/misc.py +++ b/src/calibre/devices/misc.py @@ -174,3 +174,33 @@ class GEMEI(USBMS): EBOOK_DIR_MAIN = 'eBooks' SUPPORTS_SUB_DIRS = True +class LUMIREAD(USBMS): + name = 'Acer Lumiread Device Interface' + gui_name = 'Lumiread' + description = _('Communicate with the Acer Lumiread') + author = 'Kovid Goyal' + supported_platforms = ['windows', 'osx', 'linux'] + + # Ordered list of supported formats + FORMATS = ['epub', 'pdf', 'mobi', 'chm', 'txt', 'doc', 'docx', 'rtf'] + + VENDOR_ID = [0x1025] + PRODUCT_ID = [0x048d] + BCD = [0x323] + + EBOOK_DIR_MAIN = EBOOK_DIR_CARD_A = 'books' + SUPPORTS_SUB_DIRS = True + + THUMBNAIL_HEIGHT = 200 + + def upload_cover(self, path, filename, metadata, filepath): + if metadata.thumbnail and metadata.thumbnail[-1]: + cfilepath = filepath.replace('/', os.sep) + cfilepath = cfilepath.replace(os.sep+'books'+os.sep, + os.sep+'covers'+os.sep, 1) + pdir = os.path.dirname(cfilepath) + if not os.exists(pdir): + os.makedirs(pdir) + with open(cfilepath+'.jpg', 'wb') as f: + f.write(metadata.thumbnail[-1]) +