From d367ee3fe5e019534aba95437306dfdab04ccfec Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 2 Apr 2011 23:00:14 -0600 Subject: [PATCH 1/4] Adjust screen size in Kobo profile --- src/calibre/customize/profiles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index bebaebced6..346adf4737 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -470,8 +470,8 @@ class KoboReaderOutput(OutputProfile): description = _('This profile is intended for the Kobo Reader.') - screen_size = (540, 718) - comic_screen_size = (540, 718) + screen_size = (536, 710) + comic_screen_size = (536, 710) dpi = 168.451 fbase = 12 fsizes = [7.5, 9, 10, 12, 15.5, 20, 22, 24] From d872bc58582da52da38468974d656ea345c8ff94 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 2 Apr 2011 23:05:53 -0600 Subject: [PATCH 2/4] ... --- recipes/hawaii.recipe | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/recipes/hawaii.recipe b/recipes/hawaii.recipe index ae98e46009..64ee69a0db 100644 --- a/recipes/hawaii.recipe +++ b/recipes/hawaii.recipe @@ -2,7 +2,7 @@ from calibre.web.feeds.news import BasicNewsRecipe class AdvancedUserRecipe1282101454(BasicNewsRecipe): title = 'West Hawaii Today' - __author__ = 'Tony Stegall' + __author__ = 'Tony Stegall, fixed by HK' language = 'en' description = 'Westhawaiitoday.com' publisher = 'West Hawaii ' @@ -15,7 +15,14 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe): masthead_url = 'http://images.townnews.com/westhawaiitoday.com/art/whttoplogo.gif' - - feeds = [ 'http://www.westhawaiitoday.com/rss.xml'] - + feeds = [ + ('http://www.westhawaiitoday.com/taxonomy/term/2/feed'), #Local News + ('http://www.westhawaiitoday.com/taxonomy/term/15/feed'), #Local Sports + ('http://www.westhawaiitoday.com/taxonomy/term/4/feed'), #Local Features + ('http://www.westhawaiitoday.com/taxonomy/term/12/feed'), #Obituaries + ('http://www.westhawaiitoday.com/taxonomy/term/18/feed'), #Letters + ('http://www.westhawaiitoday.com/taxonomy/term/19/feed'), #Editorial + ('http://www.westhawaiitoday.com/taxonomy/term/20/feed'), #columns + ('http://www.westhawaiitoday.com/taxonomy/term/13/feed') #Volcano Update (Sundays) + ] From 1d84c0d6ac90f04bcadbea0dffec75f1d38677db Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 3 Apr 2011 13:52:59 -0600 Subject: [PATCH 3/4] developpez.com by louhike --- recipes/developpez.recipe | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 recipes/developpez.recipe diff --git a/recipes/developpez.recipe b/recipes/developpez.recipe new file mode 100644 index 0000000000..707e702c0a --- /dev/null +++ b/recipes/developpez.recipe @@ -0,0 +1,21 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1301849956(BasicNewsRecipe): + title = u'Developpez.com' + description = u'Toutes les news du site Developpez.com' + publisher = u'Developpez.com' + timefmt = ' [%a, %d %b, %Y]' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'ISO-8859-1' + language = 'fr' + __author__ = 'louhike' + remove_javascript = True + keep_only_tags = [dict(name='div', attrs={'class':'content'})] + + feeds = [(u'Tous les articles', u'http://www.developpez.com/index/rss')] + + def get_cover_url(self): + return 'http://javascript.developpez.com/template/images/logo.gif' + From 492d16e5c996418ec311cfc5a1a2462b1889eaea Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 3 Apr 2011 14:31:14 -0600 Subject: [PATCH 4/4] ODT Input: Fix handling of the element. Fixes #749655 (Private bug) --- src/odf/odf2xhtml.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/odf/odf2xhtml.py b/src/odf/odf2xhtml.py index 390d407d16..26da9d9905 100644 --- a/src/odf/odf2xhtml.py +++ b/src/odf/odf2xhtml.py @@ -1386,12 +1386,19 @@ ol, ul { padding-left: 2em; } self.purgedata() def s_text_s(self, tag, attrs): - """ Generate a number of spaces. ODF has an element; HTML uses   - We use   so we can send the output through an XML parser if we desire to + # Changed by Kovid to fix non breaking spaces being prepended to + # element instead of being part of the text flow. + # We don't use an entity for the nbsp as the contents of self.data will + # be escaped on writeout. + """ Generate a number of spaces. We use the non breaking space for + the text:s ODF element. """ - c = attrs.get( (TEXTNS,'c'),"1") - for x in xrange(int(c)): - self.writeout(' ') + try: + c = int(attrs.get((TEXTNS, 'c'), 1)) + except: + c = 0 + if c > 0: + self.data.append(u'\u00a0'*c) def s_text_span(self, tag, attrs): """ The element matches the element in HTML. It is