diff --git a/resources/recipes/nytimes_sub.recipe b/resources/recipes/nytimes_sub.recipe index bccfb11bbe..f636b1060f 100644 --- a/resources/recipes/nytimes_sub.recipe +++ b/resources/recipes/nytimes_sub.recipe @@ -17,7 +17,7 @@ class NYTimes(BasicNewsRecipe): language = 'en' description = 'Daily news from the New York Times (subscription version)' - timefmt = '' + timefmt = ' [%a, %b %d, %Y]' needs_subscription = True remove_tags_before = dict(id='article') remove_tags_after = dict(id='article') @@ -44,6 +44,9 @@ class NYTimes(BasicNewsRecipe): #open('/t/log.html', 'wb').write(raw) return br + def short_title(self): + return 'NY Times' + def parse_index(self): soup = self.index_to_soup('http://www.nytimes.com/pages/todayspaper/index.html') diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index 5f65e0f11d..36ffc19cbf 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -404,7 +404,7 @@ from calibre.devices.hanlin.driver import HANLINV3, HANLINV5, BOOX from calibre.devices.blackberry.driver import BLACKBERRY from calibre.devices.cybookg3.driver import CYBOOKG3, CYBOOK_OPUS 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.irexdr.driver import IREXDR1000 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.nuut2.driver import NUUT2 from calibre.devices.iriver.driver import IRIVER_STORY +from calibre.devices.binatone.driver import README from calibre.ebooks.metadata.fetch import GoogleBooks, ISBNDB, Amazon plugins = [HTML2ZIP, PML2PMLZ, GoogleBooks, ISBNDB, Amazon] @@ -481,8 +482,10 @@ plugins += [ ITALICA, SHINEBOOK, ECLICTO, + DBOOK, BOOX, EB600, + README, ] plugins += [x for x in list(locals().values()) if isinstance(x, type) and \ x.__name__.endswith('MetadataReader')] diff --git a/src/calibre/devices/binatone/__init__.py b/src/calibre/devices/binatone/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/calibre/devices/binatone/driver.py b/src/calibre/devices/binatone/driver.py new file mode 100644 index 0000000000..aca08df27d --- /dev/null +++ b/src/calibre/devices/binatone/driver.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +__license__ = 'GPL v3' +__copyright__ = '2009, John Schember ' +__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) \ No newline at end of file diff --git a/src/calibre/devices/eb600/driver.py b/src/calibre/devices/eb600/driver.py index 515fdc0765..9be9e27864 100644 --- a/src/calibre/devices/eb600/driver.py +++ b/src/calibre/devices/eb600/driver.py @@ -145,7 +145,7 @@ class ECLICTO(EB600): EBOOK_DIR_MAIN = 'Text' EBOOK_DIR_CARD_A = '' -class Dbook(EB600): +class DBOOK(EB600): name = 'Airis Dbook Device Interface' gui_name = 'Airis Dbook' diff --git a/src/calibre/devices/hanlin/driver.py b/src/calibre/devices/hanlin/driver.py index 79b17acde2..aee2a70fd5 100644 --- a/src/calibre/devices/hanlin/driver.py +++ b/src/calibre/devices/hanlin/driver.py @@ -115,7 +115,7 @@ class BOOX(HANLINV3): supported_platforms = ['windows', 'osx', 'linux'] # 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] PRODUCT_ID = [0xa4a5] diff --git a/src/calibre/gui2/wizard/__init__.py b/src/calibre/gui2/wizard/__init__.py index f2e5d945e0..85dbf1d344 100644 --- a/src/calibre/gui2/wizard/__init__.py +++ b/src/calibre/gui2/wizard/__init__.py @@ -89,9 +89,15 @@ class Sony500(Device): class Sony505(Sony500): output_format = 'EPUB' - name = 'SONY Reader Pocket/Touch Edition' + name = 'SONY Reader 6" and Touch Edition' id = 'prs505' +class Sony300(Sony505): + + name = 'SONY Reader Pocket Edition' + id = 'prs300' + output_profile = 'sony300' + class Sony900(Sony505): name = 'SONY Reader Daily Edition' @@ -119,14 +125,6 @@ class CybookOpus(CybookG3): output_profile = '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): name = 'iPhone/iTouch + Stanza' @@ -141,14 +139,45 @@ class Android(Device): manufacturer = 'Google/HTC' id = 'android' -class Hanlin(Device): +class HanlinV3(Device): name = 'Hanlin V3' - output_format = 'MOBI' + output_format = 'EPUB' output_profile = 'hanlinv3' - manufacturer = 'Hanlin' + manufacturer = 'Jinke' 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(): for x in globals().values(): if isinstance(x, type) and issubclass(x, Device): diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index bffe0b7f34..bac0023688 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -275,6 +275,9 @@ class BasicNewsRecipe(Recipe): # See the built-in profiles for examples of these settings. + def short_title(self): + return self.title + def get_cover_url(self): ''' 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): if dir is None: 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.author_sort = __appname__ mi.publication_type = 'periodical:'+self.publication_type