Device driver for the Binatone Readme. Fix #4324 (Better naming of recipe downloads)

This commit is contained in:
Kovid Goyal 2009-12-28 09:32:17 -07:00
commit 83951981ba
8 changed files with 108 additions and 17 deletions

View File

@ -17,7 +17,7 @@ class NYTimes(BasicNewsRecipe):
language = 'en' language = 'en'
description = 'Daily news from the New York Times (subscription version)' description = 'Daily news from the New York Times (subscription version)'
timefmt = '' timefmt = ' [%a, %b %d, %Y]'
needs_subscription = True needs_subscription = True
remove_tags_before = dict(id='article') remove_tags_before = dict(id='article')
remove_tags_after = dict(id='article') remove_tags_after = dict(id='article')
@ -44,6 +44,9 @@ class NYTimes(BasicNewsRecipe):
#open('/t/log.html', 'wb').write(raw) #open('/t/log.html', 'wb').write(raw)
return br return br
def short_title(self):
return 'NY Times'
def parse_index(self): def parse_index(self):
soup = self.index_to_soup('http://www.nytimes.com/pages/todayspaper/index.html') soup = self.index_to_soup('http://www.nytimes.com/pages/todayspaper/index.html')

View File

@ -404,7 +404,7 @@ from calibre.devices.hanlin.driver import HANLINV3, HANLINV5, BOOX
from calibre.devices.blackberry.driver import BLACKBERRY from calibre.devices.blackberry.driver import BLACKBERRY
from calibre.devices.cybookg3.driver import CYBOOKG3, CYBOOK_OPUS from calibre.devices.cybookg3.driver import CYBOOKG3, CYBOOK_OPUS
from calibre.devices.eb600.driver import EB600, COOL_ER, SHINEBOOK, \ from calibre.devices.eb600.driver import EB600, COOL_ER, SHINEBOOK, \
POCKETBOOK360, GER2, ITALICA, ECLICTO POCKETBOOK360, GER2, ITALICA, ECLICTO, DBOOK
from calibre.devices.iliad.driver import ILIAD from calibre.devices.iliad.driver import ILIAD
from calibre.devices.irexdr.driver import IREXDR1000 from calibre.devices.irexdr.driver import IREXDR1000
from calibre.devices.jetbook.driver import JETBOOK from calibre.devices.jetbook.driver import JETBOOK
@ -417,6 +417,7 @@ from calibre.devices.nokia.driver import N770, N810
from calibre.devices.eslick.driver import ESLICK from calibre.devices.eslick.driver import ESLICK
from calibre.devices.nuut2.driver import NUUT2 from calibre.devices.nuut2.driver import NUUT2
from calibre.devices.iriver.driver import IRIVER_STORY from calibre.devices.iriver.driver import IRIVER_STORY
from calibre.devices.binatone.driver import README
from calibre.ebooks.metadata.fetch import GoogleBooks, ISBNDB, Amazon from calibre.ebooks.metadata.fetch import GoogleBooks, ISBNDB, Amazon
plugins = [HTML2ZIP, PML2PMLZ, GoogleBooks, ISBNDB, Amazon] plugins = [HTML2ZIP, PML2PMLZ, GoogleBooks, ISBNDB, Amazon]
@ -481,8 +482,10 @@ plugins += [
ITALICA, ITALICA,
SHINEBOOK, SHINEBOOK,
ECLICTO, ECLICTO,
DBOOK,
BOOX, BOOX,
EB600, EB600,
README,
] ]
plugins += [x for x in list(locals().values()) if isinstance(x, type) and \ plugins += [x for x in list(locals().values()) if isinstance(x, type) and \
x.__name__.endswith('MetadataReader')] x.__name__.endswith('MetadataReader')]

View File

View File

@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john at nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Device driver for Bookeen's Cybook Gen 3
'''
from calibre.devices.usbms.driver import USBMS
class README(USBMS):
name = 'Binatone Readme Device Interface'
gui_name = 'Binatone Readme'
description = _('Communicate with the Binatone Readme eBook reader.')
author = 'John Schember'
supported_platforms = ['windows', 'osx', 'linux']
# Ordered list of supported formats
# Be sure these have an entry in calibre.devices.mime
FORMATS = ['txt']
VENDOR_ID = [0x04fc]
PRODUCT_ID = [0x5563]
BCD = [0x0100]
VENDOR_NAME = ''
WINDOWS_MAIN_MEM = 'MASS_STORAGE'
WINDOWS_CARD_A_MEM = 'MASS_STORAGE'
MAIN_MEMORY_VOLUME_LABEL = 'Readme Main Memory'
STORAGE_CARD_VOLUME_LABEL = 'Readme Storage Card'
SUPPORTS_SUB_DIRS = True
def windows_sort_drives(self, drives):
main = drives.get('main', None)
card = drives.get('carda', None)
if card and main and card < main:
drives['main'] = card
drives['carda'] = main
return drives
def linux_swap_drives(self, drives):
if len(drives) < 2: return drives
drives = list(drives)
t = drives[0]
drives[0] = drives[1]
drives[1] = t
return tuple(drives)

View File

@ -145,7 +145,7 @@ class ECLICTO(EB600):
EBOOK_DIR_MAIN = 'Text' EBOOK_DIR_MAIN = 'Text'
EBOOK_DIR_CARD_A = '' EBOOK_DIR_CARD_A = ''
class Dbook(EB600): class DBOOK(EB600):
name = 'Airis Dbook Device Interface' name = 'Airis Dbook Device Interface'
gui_name = 'Airis Dbook' gui_name = 'Airis Dbook'

View File

@ -115,7 +115,7 @@ class BOOX(HANLINV3):
supported_platforms = ['windows', 'osx', 'linux'] supported_platforms = ['windows', 'osx', 'linux']
# Ordered list of supported formats # Ordered list of supported formats
FORMATS = ['ebub', 'pdf', 'html', 'txt', 'rtf', 'mobi', 'prc', 'chm'] FORMATS = ['epub', 'pdf', 'html', 'txt', 'rtf', 'mobi', 'prc', 'chm']
VENDOR_ID = [0x0525] VENDOR_ID = [0x0525]
PRODUCT_ID = [0xa4a5] PRODUCT_ID = [0xa4a5]

View File

@ -89,9 +89,15 @@ class Sony500(Device):
class Sony505(Sony500): class Sony505(Sony500):
output_format = 'EPUB' output_format = 'EPUB'
name = 'SONY Reader Pocket/Touch Edition' name = 'SONY Reader 6" and Touch Edition'
id = 'prs505' id = 'prs505'
class Sony300(Sony505):
name = 'SONY Reader Pocket Edition'
id = 'prs300'
output_profile = 'sony300'
class Sony900(Sony505): class Sony900(Sony505):
name = 'SONY Reader Daily Edition' name = 'SONY Reader Daily Edition'
@ -119,14 +125,6 @@ class CybookOpus(CybookG3):
output_profile = 'cybook_opus' output_profile = 'cybook_opus'
id = 'cybook_opus' id = 'cybook_opus'
class BeBook(Device):
name = 'BeBook or BeBook Mini'
output_format = 'EPUB'
output_profile = 'sony'
manufacturer = 'Endless Ideas'
id = 'bebook'
class iPhone(Device): class iPhone(Device):
name = 'iPhone/iTouch + Stanza' name = 'iPhone/iTouch + Stanza'
@ -141,14 +139,45 @@ class Android(Device):
manufacturer = 'Google/HTC' manufacturer = 'Google/HTC'
id = 'android' id = 'android'
class Hanlin(Device): class HanlinV3(Device):
name = 'Hanlin V3' name = 'Hanlin V3'
output_format = 'MOBI' output_format = 'EPUB'
output_profile = 'hanlinv3' output_profile = 'hanlinv3'
manufacturer = 'Hanlin' manufacturer = 'Jinke'
id = 'hanlinv3' id = 'hanlinv3'
class HanlinV5(HanlinV3):
name = 'Hanlin V5'
output_profile = 'hanlinv5'
id = 'hanlinv5'
class BeBook(HanlinV3):
name = 'BeBook'
manufacturer = 'Endless Ideas'
id = 'bebook'
class BeBookMini(HanlinV5):
name = 'BeBook Mini'
manufacturer = 'Endless Ideas'
id = 'bebook_mini'
class EZReader(HanlinV3):
name = 'EZReader'
manufacturer = 'Astak'
id = 'ezreader'
class EZReaderPP(HanlinV5):
name = 'EZReader Pocket Pro'
manufacturer = 'Astak'
id = 'ezreader_pp'
def get_devices(): def get_devices():
for x in globals().values(): for x in globals().values():
if isinstance(x, type) and issubclass(x, Device): if isinstance(x, type) and issubclass(x, Device):

View File

@ -275,6 +275,9 @@ class BasicNewsRecipe(Recipe):
# See the built-in profiles for examples of these settings. # See the built-in profiles for examples of these settings.
def short_title(self):
return self.title
def get_cover_url(self): def get_cover_url(self):
''' '''
Return a :term:`URL` to the cover image for this issue or `None`. Return a :term:`URL` to the cover image for this issue or `None`.
@ -886,7 +889,7 @@ class BasicNewsRecipe(Recipe):
def create_opf(self, feeds, dir=None): def create_opf(self, feeds, dir=None):
if dir is None: if dir is None:
dir = self.output_dir dir = self.output_dir
mi = MetaInformation(self.title + strftime(self.timefmt), [__appname__]) mi = MetaInformation(self.short_title() + strftime(self.timefmt), [__appname__])
mi.publisher = __appname__ mi.publisher = __appname__
mi.author_sort = __appname__ mi.author_sort = __appname__
mi.publication_type = 'periodical:'+self.publication_type mi.publication_type = 'periodical:'+self.publication_type