diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index 64da7f431d..e8f6870016 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -356,6 +356,7 @@ from calibre.devices.bebook.driver import BEBOOK, BEBOOK_MINI from calibre.devices.blackberry.driver import BLACKBERRY from calibre.devices.cybookg3.driver import CYBOOKG3 from calibre.devices.eb600.driver import EB600 +from calibre.devices.iliad.driver import ILIAD from calibre.devices.irexdr.driver import IREXDR1000 from calibre.devices.jetbook.driver import JETBOOK from calibre.devices.kindle.driver import KINDLE, KINDLE2, KINDLE_DX @@ -401,6 +402,7 @@ plugins += [ BLACKBERRY, CYBOOKG3, EB600, + ILIAD, IREXDR1000, JETBOOK, KINDLE, diff --git a/src/calibre/devices/iliad/__init__.py b/src/calibre/devices/iliad/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/calibre/devices/iliad/driver.py b/src/calibre/devices/iliad/driver.py new file mode 100644 index 0000000000..403598d506 --- /dev/null +++ b/src/calibre/devices/iliad/driver.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +__license__ = 'GPL 3' +__copyright__ = '2009, John Schember ' +__docformat__ = 'restructuredtext en' + +''' +Device driver for IRex Iliad +''' + +import os + +from calibre.devices.usbms.driver import USBMS + +class ILIAD(USBMS): + name = 'IRex Iliad Device Interface' + description = _('Communicate with the IRex Iliad eBook reader.') + author = _('John Schember') + supported_platforms = ['windows', 'linux'] + + + # Ordered list of supported formats + # Be sure these have an entry in calibre.devices.mime + FORMATS = ['mobi', 'prc', 'html', 'pdf', 'txt'] + + VENDOR_ID = [0x04cc] + PRODUCT_ID = [0x1a64] + BCD = [0x100] + + VENDOR_NAME = 'IREX' + WINDOWS_MAIN_MEM = 'ILIAD' + + #OSX_MAIN_MEM = '' + + MAIN_MEMORY_VOLUME_LABEL = 'IRex Iliad Main Memory' + + EBOOK_DIR_MAIN = 'books' + SUPPORTS_SUB_DIRS = True + + def delete_books(self, paths, end_session=True): + for i, path in enumerate(paths): + self.report_progress((i+1) / float(len(paths)), _('Removing books from device...')) + if os.path.exists(path): + os.unlink(path) + + filepath, ext = os.path.splitext(path) + + # Delete the ebook auxiliary file + if os.path.exists(filepath + '.mbp'): + os.unlink(filepath + '.mbp') + + try: + os.removedirs(os.path.dirname(path)) + except: + pass + + self.report_progress(1.0, _('Removing books from device...'))