Driver and profiles for Irex Digital Reader

This commit is contained in:
Kovid Goyal 2009-07-10 20:38:29 -06:00
commit b457af8d31
5 changed files with 101 additions and 4 deletions

View File

@ -349,6 +349,7 @@ from calibre.devices.bebook.driver import BEBOOK, BEBOOK_MINI
from calibre.devices.blackberry.driver import BLACKBERRY from calibre.devices.blackberry.driver import BLACKBERRY
from calibre.devices.cybookg3.driver import CYBOOKG3 from calibre.devices.cybookg3.driver import CYBOOKG3
from calibre.devices.eb600.driver import EB600 from calibre.devices.eb600.driver import EB600
from calibre.devices.irexdr.driver import IREXDR1000
from calibre.devices.jetbook.driver import JETBOOK from calibre.devices.jetbook.driver import JETBOOK
from calibre.devices.kindle.driver import KINDLE, KINDLE2, KINDLE_DX from calibre.devices.kindle.driver import KINDLE, KINDLE2, KINDLE_DX
from calibre.devices.prs500.driver import PRS500 from calibre.devices.prs500.driver import PRS500
@ -393,6 +394,7 @@ plugins += [
BLACKBERRY, BLACKBERRY,
CYBOOKG3, CYBOOKG3,
EB600, EB600,
IREXDR1000,
JETBOOK, JETBOOK,
KINDLE, KINDLE,
KINDLE2, KINDLE2,

View File

@ -112,6 +112,7 @@ class CybookG3Input(InputProfile):
class CybookOpusInput(InputProfile): class CybookOpusInput(InputProfile):
author = 'John Schember'
name = 'Cybook Opus' name = 'Cybook Opus'
short_name = 'cybook_opus' short_name = 'cybook_opus'
description = _('This profile is intended for the Cybook Opus.') description = _('This profile is intended for the Cybook Opus.')
@ -134,9 +135,33 @@ class KindleInput(InputProfile):
fbase = 16 fbase = 16
fsizes = [12, 12, 14, 16, 18, 20, 22, 24] 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 IRexDR1000Input(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, input_profiles = [InputProfile, SonyReaderInput, MSReaderInput,
MobipocketInput, HanlinV3Input, CybookG3Input, KindleInput] MobipocketInput, HanlinV3Input, CybookG3Input, CybookOpusInput, KindleInput,
IlliadInput, IRexDR1000Input]
class OutputProfile(Plugin): class OutputProfile(Plugin):
@ -236,6 +261,7 @@ class CybookG3Output(OutputProfile):
class CybookOpusOutput(OutputProfile): class CybookOpusOutput(OutputProfile):
author = 'John Schember'
name = 'Cybook Opus' name = 'Cybook Opus'
short_name = 'cybook_opus' short_name = 'cybook_opus'
description = _('This profile is intended for the Cybook Opus.') description = _('This profile is intended for the Cybook Opus.')
@ -291,8 +317,21 @@ class IlliadOutput(OutputProfile):
fbase = 12 fbase = 12
fsizes = [7.5, 9, 10, 12, 15.5, 20, 22, 24] fsizes = [7.5, 9, 10, 12, 15.5, 20, 22, 24]
class IRexDR1000Output(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, 14, 16, 18, 20, 22, 24]
output_profiles = [OutputProfile, SonyReaderOutput, MSReaderOutput, output_profiles = [OutputProfile, SonyReaderOutput, MSReaderOutput,
MobipocketOutput, HanlinV3Output, CybookG3Output, KindleOutput, MobipocketOutput, HanlinV3Output, CybookG3Output, CybookOpusOutput,
SonyReaderLandscapeOutput, KindleDXOutput] KindleOutput, SonyReaderLandscapeOutput, KindleDXOutput, IlliadOutput,
IRexDR1000Output]

View File

@ -9,7 +9,6 @@ import shutil
from itertools import cycle from itertools import cycle
from calibre import sanitize_file_name as sanitize from calibre import sanitize_file_name as sanitize
from calibre.devices.errors import DeviceError, FreeSpaceError
from calibre.devices.usbms.driver import USBMS from calibre.devices.usbms.driver import USBMS
import calibre.devices.cybookg3.t2b as t2b import calibre.devices.cybookg3.t2b as t2b

View File

View File

@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
__license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__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...'))