From afd66f95b87de587bb36f1f3ccf909250e6e978e Mon Sep 17 00:00:00 2001 From: John Schember Date: Thu, 9 Jul 2009 17:55:08 -0400 Subject: [PATCH 1/5] IRex Digtial Reader 1000 device driver (untested and only supporting windows, linux). --- src/calibre/devices/cybookg3/driver.py | 1 - src/calibre/devices/irexdr/__init__.py | 0 src/calibre/devices/irexdr/driver.py | 57 ++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 src/calibre/devices/irexdr/__init__.py create mode 100644 src/calibre/devices/irexdr/driver.py 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...')) From 9907f15319a98867f6e4b8a6287cbad5606a087d Mon Sep 17 00:00:00 2001 From: John Schember Date: Thu, 9 Jul 2009 18:19:05 -0400 Subject: [PATCH 2/5] DR1000 profile, Enable new profiles. --- src/calibre/customize/profiles.py | 43 +++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index 69afd77a24..53d396becb 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -112,6 +112,7 @@ class CybookG3Input(InputProfile): class CybookOpusInput(InputProfile): + author = 'John Schember' name = 'Cybook Opus' short_name = 'cybook_opus' description = _('This profile is intended for the Cybook Opus.') @@ -134,9 +135,33 @@ class KindleInput(InputProfile): fbase = 16 fsizes = [12, 12, 14, 16, 18, 20, 22, 24] +class IlliadInput(InputProfile): + + name = 'Illiad' + short_name = 'illiad' + description = _('This profile is intended for the Irex Illiad.') + + screen_size = (760, 925) + dpi = 160.0 + fbase = 12 + fsizes = [7.5, 9, 10, 12, 15.5, 20, 22, 24] + +class IRexDigitalReader1000Input(InputProfile): + + author = 'John Schember' + name = 'IRex Digital Reader 1000' + short_name = 'irexdr1000' + description = _('This profile is intended for the IRex Digital Reader 1000.') + + # Screen size is a best guess + screen_size = (1024, 1280) + dpi = 160 + fbase = 16 + fsizes = [12, 14, 16, 18, 20, 22, 24] input_profiles = [InputProfile, SonyReaderInput, MSReaderInput, - MobipocketInput, HanlinV3Input, CybookG3Input, KindleInput] + MobipocketInput, HanlinV3Input, CybookG3Input, CybookOpus, KindleInput, + IlliadInput, IRexDigitalReader1000Input] class OutputProfile(Plugin): @@ -236,6 +261,7 @@ class CybookG3Output(OutputProfile): class CybookOpusOutput(OutputProfile): + author = 'John Schember' name = 'Cybook Opus' short_name = 'cybook_opus' description = _('This profile is intended for the Cybook Opus.') @@ -291,8 +317,21 @@ class IlliadOutput(OutputProfile): fbase = 12 fsizes = [7.5, 9, 10, 12, 15.5, 20, 22, 24] +class IRexDigitalReader1000Output(OutputProfile): + author = 'John Schember' + name = 'IRex Digital Reader 1000' + short_name = 'irexdr1000' + description = _('This profile is intended for the IRex Digital Reader 1000.') + + # Screen size is a best guess + screen_size = (1024, 1280) + comic_screen_size = (996, 1241) + dpi = 160 + fbase = 16 + fsizes = [12, 12, 14, 16, 18, 20, 22, 24] output_profiles = [OutputProfile, SonyReaderOutput, MSReaderOutput, MobipocketOutput, HanlinV3Output, CybookG3Output, KindleOutput, - SonyReaderLandscapeOutput, KindleDXOutput] + SonyReaderLandscapeOutput, KindleDXOutput, IlliadOutput, + IRexDigitalReader1000Output] From 7a3c3fca4219f5449915a458f1df325c74221841 Mon Sep 17 00:00:00 2001 From: John Schember Date: Thu, 9 Jul 2009 18:19:40 -0400 Subject: [PATCH 3/5] Profile fix. --- src/calibre/customize/profiles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index 53d396becb..46f2283b26 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -329,7 +329,7 @@ class IRexDigitalReader1000Output(OutputProfile): comic_screen_size = (996, 1241) dpi = 160 fbase = 16 - fsizes = [12, 12, 14, 16, 18, 20, 22, 24] + fsizes = [12, 14, 16, 18, 20, 22, 24] output_profiles = [OutputProfile, SonyReaderOutput, MSReaderOutput, MobipocketOutput, HanlinV3Output, CybookG3Output, KindleOutput, From 3039992085fe1fa39a0cdb799e9da44bd02b5643 Mon Sep 17 00:00:00 2001 From: John Schember Date: Thu, 9 Jul 2009 19:14:53 -0400 Subject: [PATCH 4/5] Shorten DR1000 profile class name. Enable DR1000 driver. --- src/calibre/customize/builtins.py | 2 ++ src/calibre/customize/profiles.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index 341a7fa37d..f776c41f62 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -349,6 +349,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.irexdr.driver import IRexDR1000 from calibre.devices.jetbook.driver import JETBOOK from calibre.devices.kindle.driver import KINDLE, KINDLE2, KINDLE_DX from calibre.devices.prs500.driver import PRS500 @@ -393,6 +394,7 @@ plugins += [ BLACKBERRY, CYBOOKG3, EB600, + IRexDR1000, JETBOOK, KINDLE, KINDLE2, diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index 46f2283b26..19c59dfb99 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -146,7 +146,7 @@ class IlliadInput(InputProfile): fbase = 12 fsizes = [7.5, 9, 10, 12, 15.5, 20, 22, 24] -class IRexDigitalReader1000Input(InputProfile): +class IRexDR1000Input(InputProfile): author = 'John Schember' name = 'IRex Digital Reader 1000' @@ -161,7 +161,7 @@ class IRexDigitalReader1000Input(InputProfile): input_profiles = [InputProfile, SonyReaderInput, MSReaderInput, MobipocketInput, HanlinV3Input, CybookG3Input, CybookOpus, KindleInput, - IlliadInput, IRexDigitalReader1000Input] + IlliadInput, IRexDR1000Input] class OutputProfile(Plugin): @@ -317,7 +317,7 @@ class IlliadOutput(OutputProfile): fbase = 12 fsizes = [7.5, 9, 10, 12, 15.5, 20, 22, 24] -class IRexDigitalReader1000Output(OutputProfile): +class IRexDR1000Output(OutputProfile): author = 'John Schember' name = 'IRex Digital Reader 1000' @@ -334,4 +334,4 @@ class IRexDigitalReader1000Output(OutputProfile): output_profiles = [OutputProfile, SonyReaderOutput, MSReaderOutput, MobipocketOutput, HanlinV3Output, CybookG3Output, KindleOutput, SonyReaderLandscapeOutput, KindleDXOutput, IlliadOutput, - IRexDigitalReader1000Output] + IRexDR1000Output] From f5ae00ad5e19d65e3378095bd2ce46af424d9b56 Mon Sep 17 00:00:00 2001 From: John Schember Date: Thu, 9 Jul 2009 19:22:08 -0400 Subject: [PATCH 5/5] Fix stupid typos. --- src/calibre/customize/builtins.py | 4 ++-- src/calibre/customize/profiles.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index f776c41f62..389a34937f 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -349,7 +349,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.irexdr.driver import IRexDR1000 +from calibre.devices.irexdr.driver import IREXDR1000 from calibre.devices.jetbook.driver import JETBOOK from calibre.devices.kindle.driver import KINDLE, KINDLE2, KINDLE_DX from calibre.devices.prs500.driver import PRS500 @@ -394,7 +394,7 @@ plugins += [ BLACKBERRY, CYBOOKG3, EB600, - IRexDR1000, + IREXDR1000, JETBOOK, KINDLE, KINDLE2, diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index 19c59dfb99..a6ffc2f243 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -160,7 +160,7 @@ class IRexDR1000Input(InputProfile): fsizes = [12, 14, 16, 18, 20, 22, 24] input_profiles = [InputProfile, SonyReaderInput, MSReaderInput, - MobipocketInput, HanlinV3Input, CybookG3Input, CybookOpus, KindleInput, + MobipocketInput, HanlinV3Input, CybookG3Input, CybookOpusInput, KindleInput, IlliadInput, IRexDR1000Input] @@ -332,6 +332,6 @@ class IRexDR1000Output(OutputProfile): fsizes = [12, 14, 16, 18, 20, 22, 24] output_profiles = [OutputProfile, SonyReaderOutput, MSReaderOutput, - MobipocketOutput, HanlinV3Output, CybookG3Output, KindleOutput, - SonyReaderLandscapeOutput, KindleDXOutput, IlliadOutput, + MobipocketOutput, HanlinV3Output, CybookG3Output, CybookOpusOutput, + KindleOutput, SonyReaderLandscapeOutput, KindleDXOutput, IlliadOutput, IRexDR1000Output]