From d39e71b34a39a9942f55fe0d079fb33ef12e70f0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 28 Dec 2009 08:04:39 -0700 Subject: [PATCH 1/8] Linux binary: Add system QT_PLUGIN_PATH to enable calibre to use the user specified Qt style --- setup/installer/linux/freeze.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/installer/linux/freeze.py b/setup/installer/linux/freeze.py index f5188bbbd0..59f4c2b39e 100644 --- a/setup/installer/linux/freeze.py +++ b/setup/installer/linux/freeze.py @@ -245,7 +245,7 @@ class LinuxFreeze(Command): export MAGICK_CONFIGURE_PATH=$base/ImageMagick/config export MAGICK_CODER_MODULE_PATH=$base/ImageMagick/modules-Q16/coders export MAGICK_CODER_FILTER_PATH=$base/ImageMagick/modules-Q16/filter - export QT_PLUGIN_PATH=$base/qtplugins + export QT_PLUGIN_PATH=$base/qtplugins:$QT_PLUGIN_PATH $loader "$@" ''')%exe) os.chmod(path, 0755) From adddcd996addf24eb39ef8211ceff714b9dbf3ba Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 28 Dec 2009 08:26:22 -0700 Subject: [PATCH 2/8] New recipes for Chowk, Dawn and The News by kwetal --- resources/recipes/chowk.recipe | 46 ++++++++++++++++ resources/recipes/dawn.recipe | 92 +++++++++++++++++++++++++++++++ resources/recipes/thenews.recipe | 78 ++++++++++++++++++++++++++ src/calibre/utils/localization.py | 1 + 4 files changed, 217 insertions(+) create mode 100644 resources/recipes/chowk.recipe create mode 100644 resources/recipes/dawn.recipe create mode 100644 resources/recipes/thenews.recipe diff --git a/resources/recipes/chowk.recipe b/resources/recipes/chowk.recipe new file mode 100644 index 0000000000..3c8ea48607 --- /dev/null +++ b/resources/recipes/chowk.recipe @@ -0,0 +1,46 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class ChowkRecipe(BasicNewsRecipe): + __license__ = 'GPL v3' + __author__ = 'kwetal' + language = 'en_IN' + version = 1 + + title = u'Chowk' + publisher = u'chowk.com' + category = u'Opinion, South Asia' + description = u'Ideas & Identities of South Asia' + + use_embedded_content = False + remove_empty_feeds = True + oldest_article = 30 + max_articles_per_feed = 100 + + #no_stylesheets = True + remove_javascript = True + encoding = 'utf-8' + + feeds = [] + feeds.append(('Chowk Articles', 'http://www.chowk.com/rss')) + + keep_only_tags = [] + keep_only_tags.append(dict(name = 'div', attrs = {'id': 'content'})) + + conversion_options = {'comments': description, 'tags': category, 'language': 'en', + 'publisher': publisher} + + extra_css = ''' + body{font-family:verdana,arial,helvetica,geneva,sans-serif;} + a {text-decoration: none; color: blue;} + div.pgtitle {font-size: x-large; font-weight: bold;} + div.wname, div.date {font-size: x-small; color: #696969;} + div.wname {margin-top: 1em;} + div.date {margin-bottom: 1em;} + div.title {font-weight: bold;} + ''' + + + def print_version(self, url): + main, sep, id = url.rpartition('/') + + return main + '/print/' + id diff --git a/resources/recipes/dawn.recipe b/resources/recipes/dawn.recipe new file mode 100644 index 0000000000..3d4ab42a07 --- /dev/null +++ b/resources/recipes/dawn.recipe @@ -0,0 +1,92 @@ +from calibre.web.feeds.news import BasicNewsRecipe +from calibre.ebooks.BeautifulSoup import Tag + +class DawnRecipe(BasicNewsRecipe): + __license__ = 'GPL v3' + __author__ = 'kwetal' + language = 'en_PK' + version = 1 + + title = u'Dawn' + publisher = u'Dawn Media Group' + category = u'News, Pakistan' + description = u'Leading English Newspaper of Pakistan covering national & international news' + + use_embedded_content = False + remove_empty_feeds = True + oldest_article = 2 + max_articles_per_feed = 100 + + no_stylesheets = True + remove_javascript = True + encoding = 'utf-8' + + # Feeds from http://www.dawn.com/wps/wcm/connect/dawn-content-library/dawn/services/rss + feeds = [] + feeds.append((u'Latest News', u'http://feedproxy.google.com/Dawn-All-News')) + feeds.append((u'Pakistan News', u'http://feeds2.feedburner.com/dawn/news/pakistan')) + feeds.append((u'World News', u'http://feeds2.feedburner.com/dawn/news/world')) + feeds.append((u'Business News', u'http://feeds2.feedburner.com/dawn/news/business')) + feeds.append((u'Sport News', u'http://feeds2.feedburner.com/dawn/news/sport')) + feeds.append((u'Cricket News', u'http://feeds2.feedburner.com/dawn/news/cricket')) + feeds.append((u'Sci-tech News', u'http://feeds2.feedburner.com/dawn/news/technology')) + feeds.append((u'Entertainment News', u'http://feeds2.feedburner.com/dawn/news/entertainment')) + feeds.append((u'Columnists', u'http://feeds2.feedburner.com/dawn/news/columnists')) + #feeds.append((u'', u'')) + + conversion_options = {'comments': description, 'tags': category, 'language': 'en', + 'publisher': publisher} + + extra_css = ''' + body{font-family:verdana,arial,helvetica,geneva,sans-serif;} + center {font-size: xx-small; color: #666666;} + strong {font-size: small; font-weight: bold;} + span.news_headline {font-size: xx-large; font-weight: bold; margin: 0em; padding: 0em} + span.news_byline {font-size: x-small; color: #696969; margin-top: 1em;} + ''' + + def print_version(self, url): + return url + '?pagedesign=Dawn_PrintlyFriendlyPage' + + def preprocess_html(self, soup): + newBody = Tag(soup, 'body') + + for cl in ['page_title', 'news_headline', 'news_byline']: + tag = soup.find('span', attrs = {'class': cl}) + if tag: + # They like their
tags; I don't: does not work well on small screens. + if tag['class'] == 'news_byline': + for br in tag.findAll('br'): + br.extract() + + newBody.append(tag) + + table = soup.find('table', attrs = {'id': 'body table'}) + if table: + for td in table.findAll('td', attrs = {'class': 'news_story'}): + for tag in td.findAll(True): + if tag.has_key('id') and tag['id'] == 'banner-img_slide': + tag.extract() + elif tag.has_key('style'): + del tag['style'] + elif tag.name == 'script': + tag.extract() + + # They like their
tags; I don't: does not work well on small screens. + center = td.find('center') + if center: + for br in center.findNextSiblings('br'): + br.extract() + for br in center.findPreviousSiblings('br'): + br.extract() + + for attr in ['align', 'valign']: + if td.has_key(attr): + del td[attr] + + td.name = 'div' + newBody.append(td) + + soup.body.replaceWith(newBody) + + return soup diff --git a/resources/recipes/thenews.recipe b/resources/recipes/thenews.recipe new file mode 100644 index 0000000000..7137b4538b --- /dev/null +++ b/resources/recipes/thenews.recipe @@ -0,0 +1,78 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class TheNewsRecipe(BasicNewsRecipe): + __license__ = 'GPL v3' + __author__ = 'kwetal' + language = 'en_PK' + version = 1 + + title = u'The News' + publisher = u'Jang Group' + category = u'News, Pakistan' + description = u'English Newspaper from Pakistan' + + use_embedded_content = False + remove_empty_feeds = True + oldest_article = 2 + max_articles_per_feed = 100 + + no_stylesheets = True + remove_javascript = True + encoding = 'iso-8859-1' + + remove_tags = [] + remove_tags.append(dict(name = 'img', attrs = {'src': 'images/thenews.gif'})) + remove_tags.append(dict(name = 'img', attrs = {'src': 'images/shim.gif'})) + + # Feeds from http://thenews.com.pk/rss.asp + feeds = [] + feeds.append((u'Latest Stories', u'http://www.thenews.com.pk/rss/thenews_updates.xml')) + feeds.append((u'Top Stories', u'http://www.thenews.com.pk/rss/thenews_topstories.xml')) + feeds.append((u'World News', u'http://www.thenews.com.pk/rss/thenews_world.xml')) + feeds.append((u'National News', u'http://www.thenews.com.pk/rss/thenews_national.xml')) + feeds.append((u'Business News', u'http://www.thenews.com.pk/rss/thenews_business.xml')) + feeds.append((u'Karachi News', u'http://www.thenews.com.pk/rss/thenews_karachi.xml')) + feeds.append((u'Lahore News', u'http://www.thenews.com.pk/rss/thenews_lahore.xml')) + feeds.append((u'Islamabad News', u'http://www.thenews.com.pk/rss/thenews_islamabad.xml')) + feeds.append((u'Peshawar News', u'http://www.thenews.com.pk/rss/thenews_peshawar.xml')) + feeds.append((u'Editorial', u'http://www.thenews.com.pk/rss/thenews_editorial.xml')) + feeds.append((u'Opinion', u'http://www.thenews.com.pk/rss/thenews_opinion.xml')) + feeds.append((u'Sports News', u'http://www.thenews.com.pk/rss/thenews_sports.xml')) + feeds.append((u'Newspost', u'http://www.thenews.com.pk/rss/thenews_newspost.xml')) + + conversion_options = {'comments': description, 'tags': category, 'language': 'en', + 'publisher': publisher, 'linearize_tables': True} + + extra_css = ''' + body{font-family:verdana,arial,helvetica,geneva,sans-serif;} + .heading_txt {font-size: x-large; font-weight: bold; text-align: left;} + .small_txt {text-align: left;} + .dateline {font-size: x-small; color: #696969; margin-top: 1em; margin-bottom: 1em} + ''' + + + def print_version(self, url): + ignore, sep, main = url.rpartition('/') + + if main.startswith('updates.asp'): + return url.replace('updates.asp', 'print.asp') + elif main.startswith('top_story_detail.asp'): + return url.replace('top_story_detail.asp', 'print3.asp') + elif main.startswith('daily_detail.asp'): + return url.replace('daily_detail.asp', 'print1.asp') + else: + return None + + def preprocess_html(self, soup): + for tr in soup.findAll('tr', attrs = {'bgcolor': True}): + del tr['bgcolor'] + + td = soup.find('td', attrs = {'class': 'small_txt', 'height': '20'}) + if td: + del td['height'] + td['class'] = 'dateline' + + return soup + + + diff --git a/src/calibre/utils/localization.py b/src/calibre/utils/localization.py index 64dadb89e4..14b7b32c8c 100644 --- a/src/calibre/utils/localization.py +++ b/src/calibre/utils/localization.py @@ -101,6 +101,7 @@ _extra_lang_codes = { 'en_IN' : _('English (IND)'), 'en_TH' : _('English (TH)'), 'en_CY' : _('English (CY)'), + 'en_PK' : _('English (PK)'), 'de_AT' : _('German (AT)'), 'nl' : _('Dutch (NL)'), 'nl_BE' : _('Dutch (BE)'), From d45a7879c1ed1c44573cd2f29de21135f8840987 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 28 Dec 2009 12:57:51 -0700 Subject: [PATCH 3/8] New recipe for The New York Magazine by Kovid Goyal. Fixes #405 (Request for new news feeds) --- resources/recipes/nymag.recipe | 74 ++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 resources/recipes/nymag.recipe diff --git a/resources/recipes/nymag.recipe b/resources/recipes/nymag.recipe new file mode 100644 index 0000000000..134624bc67 --- /dev/null +++ b/resources/recipes/nymag.recipe @@ -0,0 +1,74 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Kovid Goyal ' +''' +theatlantic.com +''' +from calibre.web.feeds.news import BasicNewsRecipe + +class NewYorkMagazine(BasicNewsRecipe): + + title = 'New York Magazine' + __author__ = 'Kovid Goyal' + description = 'Food, culture, arts and entertainment in New York' + language = 'en' + no_stylesheets = True + remove_javascript = True + encoding = 'iso-8859-1' + recursions = 1 + match_regexps = [r'http://nymag.com/.+/index[0-9]{1,2}.html$'] + keep_only_tags = [dict(id='main')] + remove_tags = [ + dict(attrs={'class':['start-discussion']}), + dict(id=['minibrowserbox', 'article-related', 'article-tools']) + ] + + PREFIX = 'http://nymag.com' + + def nymag_get_index(self): + return self.index_to_soup('http://nymag.com/includes/tableofcontents.htm') + + def parse_index(self): + soup = self.nymag_get_index() + self.cover_url = soup.find(attrs={'class':'cover'}).find('img', + src=True).get('src') + feeds = [] + current_section = 'Cover Story' + current_articles = [] + for h in soup.findAll(['h4', 'h5']): + if h.name == 'h4': + if current_section and current_articles: + feeds.append((current_section, current_articles)) + current_section = self.tag_to_string(h) + self.log('\tFound section:', current_section) + current_articles = [] + elif h.name == 'h5': + title = self.tag_to_string(h) + a = h.find('a', href=True) + if a is not None: + url = a.get('href') + if url.startswith('/'): + url = self.PREFIX + url + if title and url: + self.log('\t\tFound article:', title) + self.log('\t\t\t', url) + desc = '' + p = h.findNextSibling('p') + if p is not None: + desc = self.tag_to_string(p) + self.log('\t\t\t', desc) + current_articles.append({'title':title, 'url':url, + 'date':'', 'description':desc}) + return feeds + + def postprocess_html(self, soup, first): + for x in soup.findAll(attrs={'class':'page-navigation'}): + x.extract() + if not first: + for x in soup.findAll(attrs={'class':'header-spacing'}): + x.extract() + return soup + + + From 0ebc0cc78feb8759f813f84efe7804ef5a2e7501 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Dec 2009 08:21:11 -0700 Subject: [PATCH 4/8] Workaround for bug in OS X Leopard that causes calibre to fail to launch after the first launch --- src/calibre/utils/ipc/worker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/utils/ipc/worker.py b/src/calibre/utils/ipc/worker.py index a53d1818ba..9128673715 100644 --- a/src/calibre/utils/ipc/worker.py +++ b/src/calibre/utils/ipc/worker.py @@ -73,6 +73,12 @@ def get_func(name): return func, notification def main(): + from calibre.constants import isosx + if isosx and 'CALIBRE_WORKER_ADDRESS' not in os.environ: + # On some OS X computers launchd apparently tries to + # launch the last run process from the bundle + from calibre.gui2.main import main as gui_main + return gui_main([]) address = cPickle.loads(unhexlify(os.environ['CALIBRE_WORKER_ADDRESS'])) key = unhexlify(os.environ['CALIBRE_WORKER_KEY']) resultf = unhexlify(os.environ['CALIBRE_WORKER_RESULT']) From 369fbc48db42af68837cf23844c97f732f2504b1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Dec 2009 08:22:14 -0700 Subject: [PATCH 5/8] New recipe for The Independent by Jimmy Patrick --- resources/recipes/independent.recipe | 26 ++++++++++++++++++++++++++ src/calibre/manual/faq.rst | 2 +- src/calibre/web/feeds/input.py | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 resources/recipes/independent.recipe diff --git a/resources/recipes/independent.recipe b/resources/recipes/independent.recipe new file mode 100644 index 0000000000..d964fe39d0 --- /dev/null +++ b/resources/recipes/independent.recipe @@ -0,0 +1,26 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class Independent(BasicNewsRecipe): + title = u'The Independent' + oldest_article = 1 + language = 'en_UK' + __author__ = 'Jimmy Patrick' + max_articles_per_feed = 100 + + feeds = [(u'UK', u'http://www.independent.co.uk/news/uk/rss'), + (u'World', u'http://www.independent.co.uk/news/world/rss'), + (u'Sport', u'http://www.independent.co.uk/sport/rss'), + (u'Arts & Entertainment', u'http://www.independent.co.uk/arts-entertainment/rss'), + (u'Life & Style',u'http://www.independent.co.uk/life-style/fashion/news/rss'), + (u'Business',u'http://www.independent.co.uk/news/business/rss'), + (u'Science',u'http://www.independent.co.uk/news/science/rss'), + (u'Media',u'http://www.independent.co.uk/news/media/rss') + ] + + keep_only_tags = [dict(id=['article'])] + remove_tags = [dict(name='div', attrs={'class':'share-links'}), + dict(name='ul', attrs={'class':'article-tools'}), + dict(name='div', attrs={'class':'related-articles'}) + ] + + extra_css = "body{color:black;}" diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 8a9eb6b23f..33e144e0e5 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -301,7 +301,7 @@ Your antivirus program is wrong. |app| is a completely open source product. You How do I use purchased EPUB books with |app|? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Most purchased EPUB books have `DRM `_. This prevents |app| from opening them. You can still use |app| to store and transfer them to your SONY Reader. First, you must authorize your reader on a windows machine with Adobe Digital Editions. Once this is done, EPUB books transferred with |app| will work fine on your reader. Sometimes, the EPUB file itself is corrupted, in which case you should notify the e-book vendor. +Most purchased EPUB books have `DRM `_. This prevents |app| from opening them. You can still use |app| to store and transfer them to your SONY Reader. First, you must authorize your reader on a windows machine with Adobe Digital Editions. Once this is done, EPUB books transferred with |app| will work fine on your reader. When you purchase an epub book from a website, you will get an ".acsm" file. This file should be opened with Adobe Digital Editions, which will then download the actual ".epub" e-book. The e-book file will be stored in the folder "My Digital Editions", from where you can add it to |app|. I want some feature added to |app|. What can I do? diff --git a/src/calibre/web/feeds/input.py b/src/calibre/web/feeds/input.py index 5882dd8e7a..4f7fa64869 100644 --- a/src/calibre/web/feeds/input.py +++ b/src/calibre/web/feeds/input.py @@ -40,7 +40,7 @@ class RecipeInput(InputFormatPlugin): 'content.')), OptionRecommendation(name='dont_download_recipe', recommended_value=False, - help=_('Download latest version of builtin recipes')), + help=_('Do not download latest version of builtin recipes from the calibre server')), OptionRecommendation(name='lrf', recommended_value=False, help='Optimize fetching for subsequent conversion to LRF.'), ]) From 176d9728d7a99e6c6fed0d69e6b9952f4a5a24ec Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Dec 2009 09:04:28 -0700 Subject: [PATCH 6/8] Add framework to disable builtin recipes and disable Aftenposten, at the publishers request --- resources/recipes/aftenposten.recipe | 3 +++ resources/recipes/independent.recipe | 2 +- src/calibre/gui2/ui.py | 10 ++++++++++ src/calibre/web/feeds/input.py | 6 ++++++ src/calibre/web/feeds/news.py | 6 +++++- 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/resources/recipes/aftenposten.recipe b/resources/recipes/aftenposten.recipe index 304c7c0e02..fcc73658e9 100644 --- a/resources/recipes/aftenposten.recipe +++ b/resources/recipes/aftenposten.recipe @@ -7,6 +7,9 @@ class Aftenposten(BasicNewsRecipe): language = 'no' oldest_article = 5 max_articles_per_feed = 100 + recipe_disabled = ('The recipe to download Aftenposten has been ' + 'temporarily disabled at the publisher\'s request, while ' + 'they finalize their digital strategy.') no_stylesheets = True encoding = 'ISO-8859-1' diff --git a/resources/recipes/independent.recipe b/resources/recipes/independent.recipe index d964fe39d0..4d677b58a6 100644 --- a/resources/recipes/independent.recipe +++ b/resources/recipes/independent.recipe @@ -3,7 +3,7 @@ from calibre.web.feeds.news import BasicNewsRecipe class Independent(BasicNewsRecipe): title = u'The Independent' oldest_article = 1 - language = 'en_UK' + language = 'en_GB' __author__ = 'Jimmy Patrick' max_articles_per_feed = 100 diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 4e30c0fab5..b847186c2a 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -1736,6 +1736,16 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): d.show() self._modeless_dialogs.append(d) return + if 'calibre.web.feeds.input.RecipeDisabled' in job.details: + msg = job.details + msg = msg[msg.find('calibre.web.feeds.input.RecipeDisabled:'):] + msg = msg.partition(':')[-1] + d = error_dialog(self, _('Recipe Disabled'), + '

%s

'%msg) + d.setModal(False) + d.show() + self._modeless_dialogs.append(d) + return except: pass if job.killed: diff --git a/src/calibre/web/feeds/input.py b/src/calibre/web/feeds/input.py index 4f7fa64869..5015c1bef2 100644 --- a/src/calibre/web/feeds/input.py +++ b/src/calibre/web/feeds/input.py @@ -11,6 +11,9 @@ import os from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation from calibre.constants import numeric_version +class RecipeDisabled(Exception): + pass + class RecipeInput(InputFormatPlugin): name = 'Recipe Input' @@ -83,6 +86,9 @@ class RecipeInput(InputFormatPlugin): recipe_or_file) ro = recipe(opts, log, self.report_progress) + disabled = getattr(ro, 'recipe_disabled', None) + if disabled is not None: + raise RecipeDisabled(disabled) ro.download() self.recipe_object = ro for key, val in recipe.conversion_options.items(): diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index bac0023688..789710d764 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -270,7 +270,11 @@ class BasicNewsRecipe(Recipe): .navbar { font-family:monospace; } -''' + ''' + + #: Set to a non empty string to disable this recipe + #: The string will be used as the disabled message + recipe_disabled = None # See the built-in profiles for examples of these settings. From f703ad42dd32d59ef479c51af145937a362c3fcf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Dec 2009 14:02:36 -0700 Subject: [PATCH 7/8] Fix #4299 (New calibre-0.6.30 doesn't launch) --- setup/installer/osx/app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/installer/osx/app/main.py b/setup/installer/osx/app/main.py index 4cf995683f..85533717b4 100644 --- a/setup/installer/osx/app/main.py +++ b/setup/installer/osx/app/main.py @@ -309,7 +309,7 @@ class Py2App(object): @flush def add_qt_frameworks(self): info('\nAdding Qt Framework') - for f in ('QtCore', 'QtGui', 'QtXml', 'QtNetwork', 'QtSvg', 'QtWebkit', + for f in ('QtCore', 'QtGui', 'QtXml', 'QtNetwork', 'QtSvg', 'QtWebKit', 'QtXmlPatterns', 'phonon'): self.add_qt_framework(f) for d in glob.glob(join(SW, 'qt', 'plugins', '*')): From 2668df9f9367727caabfa0201537e889a9e446ea Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Dec 2009 15:40:42 -0700 Subject: [PATCH 8/8] Driver for the LongShine ShineBook --- src/calibre/customize/builtins.py | 2 +- src/calibre/devices/eb600/driver.py | 14 ++++++++++++++ src/calibre/manual/faq.rst | 2 +- src/calibre/utils/ipc/worker.py | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index 36ffc19cbf..6e0c9321cd 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -462,6 +462,7 @@ plugins += [ ILIAD, IREXDR1000, JETBOOK, + SHINEBOOK, KINDLE, KINDLE2, KINDLE_DX, @@ -480,7 +481,6 @@ plugins += [ POCKETBOOK360, GER2, ITALICA, - SHINEBOOK, ECLICTO, DBOOK, BOOX, diff --git a/src/calibre/devices/eb600/driver.py b/src/calibre/devices/eb600/driver.py index 9be9e27864..fe89e57a94 100644 --- a/src/calibre/devices/eb600/driver.py +++ b/src/calibre/devices/eb600/driver.py @@ -16,6 +16,7 @@ Windows PNP strings: ''' from calibre.devices.usbms.driver import USBMS +from calibre.constants import iswindows class EB600(USBMS): @@ -81,6 +82,19 @@ class SHINEBOOK(EB600): VENDOR_NAME = 'LONGSHIN' WINDOWS_MAIN_MEM = 'ESHINEBOOK' + MAIN_MEMORY_VOLUME_LABEL = 'ShineBook Main Memory' + STORAGE_CARD_VOLUME_LABEL = 'ShineBook Storage Card' + + + @classmethod + def can_handle(cls, dev, debug=False): + try: + if not iswindows: + return dev[4] == 'ShineBook' + except: + return True + + class POCKETBOOK360(EB600): diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 33e144e0e5..0319f5bb21 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -81,7 +81,7 @@ Device Integration What devices does |app| support? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -At the moment |app| has full support for the SONY PRS 300/500/505/600/700/900, Barnes & Noble Nook, Cybook Gen 3/Opus, Amazon Kindle 1/2/DX, Netronix EB600, Ectaco Jetbook, BeBook/BeBook Mini, Irex Illiad/DR1000, Foxit eSlick, PocketBook 360, Italica, eClicto, Iriver Story, Airis dBook, various Android phones and the iPhone. In addition, using the :guilabel:`Save to disk` function you can use it with any ebook reader that exports itself as a USB disk. +At the moment |app| has full support for the SONY PRS 300/500/505/600/700/900, Barnes & Noble Nook, Cybook Gen 3/Opus, Amazon Kindle 1/2/DX, Longshine ShineBook, Ectaco Jetbook, BeBook/BeBook Mini, Irex Illiad/DR1000, Foxit eSlick, PocketBook 360, Italica, eClicto, Iriver Story, Airis dBook, various Android phones and the iPhone. In addition, using the :guilabel:`Save to disk` function you can use it with any ebook reader that exports itself as a USB disk. How can I help get my device supported in |app|? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/calibre/utils/ipc/worker.py b/src/calibre/utils/ipc/worker.py index 9128673715..3d04298a65 100644 --- a/src/calibre/utils/ipc/worker.py +++ b/src/calibre/utils/ipc/worker.py @@ -78,7 +78,7 @@ def main(): # On some OS X computers launchd apparently tries to # launch the last run process from the bundle from calibre.gui2.main import main as gui_main - return gui_main([]) + return gui_main(['calibre']) address = cPickle.loads(unhexlify(os.environ['CALIBRE_WORKER_ADDRESS'])) key = unhexlify(os.environ['CALIBRE_WORKER_KEY']) resultf = unhexlify(os.environ['CALIBRE_WORKER_RESULT'])