From bab502e6543b2997158b23a72d6f41e119e15136 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 1 May 2011 09:58:55 -0600 Subject: [PATCH 1/4] Fix Brand Eins --- recipes/brand_eins.recipe | 13 ++++++++----- src/calibre/manual/faq.rst | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/recipes/brand_eins.recipe b/recipes/brand_eins.recipe index 15e1d3ccca..e6fe57b334 100644 --- a/recipes/brand_eins.recipe +++ b/recipes/brand_eins.recipe @@ -3,7 +3,8 @@ __license__ = 'GPL v3' __copyright__ = '2010, Constantin Hofstetter , Steffen Siebert ' -__version__ = '0.98' # 2011-04-10 +__version__ = '0.98' + ''' http://brandeins.de - Wirtschaftsmagazin ''' import re import string @@ -13,8 +14,8 @@ from calibre.web.feeds.recipes import BasicNewsRecipe class BrandEins(BasicNewsRecipe): title = u'brand eins' - __author__ = 'Constantin Hofstetter; Steffen Siebert' - description = u'Wirtschaftsmagazin: Gets the last full issue on default. Set a integer value for the username-field to get older issues: 1 -> the newest (but not complete) issue, 2 -> the last complete issue (default), 3 -> the issue before 2 etc.' + __author__ = 'Constantin Hofstetter' + description = u'Wirtschaftsmagazin' publisher ='brandeins.de' category = 'politics, business, wirtschaft, Germany' use_embedded_content = False @@ -105,10 +106,11 @@ class BrandEins(BasicNewsRecipe): keys = issue_map.keys() keys.sort() keys.reverse() - selected_issue = issue_map[keys[issue-1]] + selected_issue_key = keys[issue - 1] + selected_issue = issue_map[selected_issue_key] url = selected_issue.get('href', False) # Get the title for the magazin - build it out of the title of the cover - take the issue and year; - self.title = "brand eins "+ re.search(r"(?P\d\d\/\d\d\d\d)", selected_issue.find('img').get('title', False)).group('date') + self.title = "brand eins " + selected_issue_key[4:] + "/" + selected_issue_key[0:4] url = 'http://brandeins.de/'+url # url = "http://www.brandeins.de/archiv/magazin/tierisch.html" @@ -161,3 +163,4 @@ class BrandEins(BasicNewsRecipe): current_articles.append({'title': title, 'url': url, 'description': description, 'date':''}) titles_and_articles.append([chapter_title, current_articles]) return titles_and_articles + diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 816ce7c496..08ebb6506b 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -468,7 +468,7 @@ If it still wont launch, start a command prompt (press the windows key and R; th Post any output you see in a help message on the `Forum `_. -|app| freeze when I click on anything? +|app| freezes when I click on anything? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are three possible things I know of, that can cause this: From 186a47da8ce95287db54d0706ff556a4363d0860 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 1 May 2011 10:33:10 -0600 Subject: [PATCH 2/4] Fix #774743 (Calibre Crash on read [open by (v) from edit-screen]) --- src/calibre/gui2/actions/view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/actions/view.py b/src/calibre/gui2/actions/view.py index c93e69f0fc..6cf5c5d5af 100644 --- a/src/calibre/gui2/actions/view.py +++ b/src/calibre/gui2/actions/view.py @@ -60,7 +60,7 @@ class ViewAction(InterfaceAction): def build_menus(self, db): self.view_menu.clear() - self.view_menu.addAction(self.qaction) + self.view_menu.addAction(self.view_action) self.view_menu.addAction(self.view_specific_action) self.view_menu.addSeparator() self.view_menu.addAction(self.action_pick_random) From 9a32f09a71ba49f727f1c298bf79915bd18f6e98 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 1 May 2011 10:46:42 -0600 Subject: [PATCH 3/4] MOBI Input: Handle MOBI files with empty tags correctly. Fixes #774785 (Private bug) --- src/calibre/ebooks/mobi/reader.py | 5 +++++ src/calibre/ebooks/oeb/base.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index d9c6853795..3d858864a8 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -253,6 +253,8 @@ class MobiReader(object): .italic { font-style: italic } + .underline { text-decoration: underline } + .mbp_pagebreak { page-break-after: always; margin: 0; display: block } @@ -601,6 +603,9 @@ class MobiReader(object): elif tag.tag == 'i': tag.tag = 'span' tag.attrib['class'] = 'italic' + elif tag.tag == 'u': + tag.tag = 'span' + tag.attrib['class'] = 'underline' elif tag.tag == 'b': tag.tag = 'span' tag.attrib['class'] = 'bold' diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 1f71e32548..db83fca496 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -1049,8 +1049,8 @@ class Manifest(object): # Remove hyperlinks with no content as they cause rendering # artifacts in browser based renderers - # Also remove empty and tags - for a in xpath(data, '//h:a[@href]|//h:i|//h:b'): + # Also remove empty , and tags + for a in xpath(data, '//h:a[@href]|//h:i|//h:b|//h:u'): if a.get('id', None) is None and a.get('name', None) is None \ and len(a) == 0 and not a.text: remove_elem(a) From 7bfa82b98308f18e7d53a590417d0dd378893416 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 1 May 2011 13:50:24 -0600 Subject: [PATCH 4/4] Fix #775048 (spelling mistake on website) --- src/calibre/manual/faq.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 08ebb6506b..2e2a8e5ae6 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -557,7 +557,7 @@ You have two choices: How is |app| licensed? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -|app| is licensed under the GNU General Public License v3 (an open source license). This means that you are free to redistribute |app| as long as you make the source code available. So if you want to put |app| on a CD with your product, you must also put the |app| source code on the CD. The source code is available for download `from googlecode `_. You are free to use the results of conversions from |app| however you want. You cannot use code, libraries from |app| in your software without maing your software open source. For details, see `The GNU GPL v3 `_. +|app| is licensed under the GNU General Public License v3 (an open source license). This means that you are free to redistribute |app| as long as you make the source code available. So if you want to put |app| on a CD with your product, you must also put the |app| source code on the CD. The source code is available for download `from googlecode `_. You are free to use the results of conversions from |app| however you want. You cannot use code, libraries from |app| in your software without making your software open source. For details, see `The GNU GPL v3 `_. How do I run calibre from my USB stick? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~