diff --git a/src/calibre/devices/cybookg3/driver.py b/src/calibre/devices/cybookg3/driver.py index eebd28ebee..9976a0f02e 100644 --- a/src/calibre/devices/cybookg3/driver.py +++ b/src/calibre/devices/cybookg3/driver.py @@ -9,7 +9,6 @@ import shutil from itertools import cycle from calibre import sanitize_file_name as sanitize -from calibre.devices.errors import DeviceError, FreeSpaceError from calibre.devices.usbms.driver import USBMS import calibre.devices.cybookg3.t2b as t2b diff --git a/src/calibre/devices/irexdr/__init__.py b/src/calibre/devices/irexdr/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/calibre/devices/irexdr/driver.py b/src/calibre/devices/irexdr/driver.py new file mode 100644 index 0000000000..69400ae0e0 --- /dev/null +++ b/src/calibre/devices/irexdr/driver.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +__license__ = 'GPL 3' +__copyright__ = '2009, John Schember ' +__docformat__ = 'restructuredtext en' + +''' +Device driver for IRex Digiatal Reader +''' + +import os + +from calibre.devices.usbms.driver import USBMS + +class IREXDR1000(USBMS): + name = 'IRex Digital Reader 1000 Device Interface' + description = _('Communicate with the IRex Digital Reader 1000 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 = ['epub', 'mobi', 'prc', 'html', 'pdf', 'txt'] + + VENDOR_ID = [0x1e6b] + PRODUCT_ID = [0x001] + BCD = [0x322] + + VENDOR_NAME = 'IREX' + WINDOWS_MAIN_MEM = 'DR1000' + + #OSX_MAIN_MEM = '' + + MAIN_MEMORY_VOLUME_LABEL = 'IRex Digital Reader 1000 Main Memory' + + EBOOK_DIR_MAIN = '' + 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...'))