From dbcda9a0d8fe5d10931187e1a2c9a4f246ce85d7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Jun 2010 08:55:28 -0600 Subject: [PATCH 1/4] Fix #5983 (Problem with localized versions with non-ascii characters in default paths) --- src/calibre/library/database2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index a08e06378c..9f9488a052 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -126,7 +126,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): self.dbpath = os.path.join(library_path, 'metadata.db') self.dbpath = os.environ.get('CALIBRE_OVERRIDE_DATABASE_PATH', self.dbpath) - if isinstance(self.dbpath, unicode): + if isinstance(self.dbpath, unicode) and not iswindows: self.dbpath = self.dbpath.encode(filesystem_encoding) self.connect() From 4b0ca2408b49844d379115415743b02ccf4abdf5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Jun 2010 10:09:23 -0600 Subject: [PATCH 2/4] Fix #5993 (New York Times recipe - ads preventing articles from being downloaded) --- src/calibre/web/fetch/simple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/web/fetch/simple.py b/src/calibre/web/fetch/simple.py index b6186f785d..41d9c4ed59 100644 --- a/src/calibre/web/fetch/simple.py +++ b/src/calibre/web/fetch/simple.py @@ -156,7 +156,7 @@ class RecursiveFetcher(object): replace = self.prepreprocess_html_ext(soup) if replace is not None: - soup = BeautifulSoup(xml_to_unicode(src, self.verbose, strip_encoding_pats=True)[0], markupMassage=nmassage) + soup = BeautifulSoup(xml_to_unicode(replace, self.verbose, strip_encoding_pats=True)[0], markupMassage=nmassage) if self.keep_only_tags: body = Tag(soup, 'body') From bf0fde48a749a348c8a1aa610a6bfae97a08cbfd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Jun 2010 10:12:28 -0600 Subject: [PATCH 3/4] Winnipeg Sun by rty --- resources/recipes/winnipeg_sun.recipe | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 resources/recipes/winnipeg_sun.recipe diff --git a/resources/recipes/winnipeg_sun.recipe b/resources/recipes/winnipeg_sun.recipe new file mode 100644 index 0000000000..fe611b8d5c --- /dev/null +++ b/resources/recipes/winnipeg_sun.recipe @@ -0,0 +1,35 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1277647803(BasicNewsRecipe): + title = u'Winnipeg Sun' + __author__ = 'rty' + __version__ = '1.0' + oldest_article = 2 + pubisher = 'www.winnipegsun.com' + description = 'Winnipeg Newspaper' + category = 'News, Winnipeg, Canada' + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'UTF-8' + remove_javascript = True + use_embedded_content = False + language = 'en_CA' + feeds = [ + (u'News', u'http://www.winnipegsun.com/news/rss.xml'), + (u'Columnists', u'http://www.winnipegsun.com/columnists/rss.xml'), + (u'Editorial', u'http://www.winnipegsun.com/comment/editorial/rss.xml'), + (u'Entertainments', u'http://www.winnipegsun.com/entertainment/rss.xml'), + (u'Life', u'http://www.winnipegsun.com/life/rss.xml'), + (u'Money', u'http://www.winnipegsun.com/money/rss.xml') + ] + keep_only_tags = [ + dict(name='div', attrs={'id':'article'}), + ] + remove_tags = [ + dict(name='div', attrs={'class':['leftBox','bottomBox clear']}), + dict(name='ul', attrs={'class':'tabs dl contentSwap'}), + dict(name='div', attrs={'id':'commentsBottom'}), + ] + remove_tags_after = [ + dict(name='div', attrs={'class':'bottomBox clear'}) + ] From 6ab5113196eceff570960a0341d3f0f27c8c10ec Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Jun 2010 10:31:56 -0600 Subject: [PATCH 4/4] Fix #5997 (Unable to Edit custom meta data screen) --- src/calibre/gui2/custom_column_widgets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/custom_column_widgets.py b/src/calibre/gui2/custom_column_widgets.py index ab3354497d..2a9c81e8ee 100644 --- a/src/calibre/gui2/custom_column_widgets.py +++ b/src/calibre/gui2/custom_column_widgets.py @@ -325,7 +325,7 @@ def populate_metadata_page(layout, db, book_id, bulk=False, two_column=False, pa # Avoid problems with multi-line widgets turnover_point = count_non_comment + 1000 ans = [] - column = row = 0 + column = row = comments_row = 0 for col in cols: dt = x[col]['datatype'] if dt == 'comments': @@ -337,11 +337,13 @@ def populate_metadata_page(layout, db, book_id, bulk=False, two_column=False, pa layout.addWidget(w.widgets[c], row, column) layout.addWidget(w.widgets[c+1], row, column+1) row += 1 + comments_row = max(comments_row, row) if row >= turnover_point: column += 2 turnover_point = count_non_comment + 1000 row = 0 if not bulk: # Add the comments fields + row = comments_row column = 0 for col in cols: dt = x[col]['datatype']