From d88067518ed3b961ae55063726ad6c11f64239db Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 16 May 2010 13:48:17 -0600 Subject: [PATCH 1/5] Fix Kobo driver regression --- src/calibre/devices/misc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/devices/misc.py b/src/calibre/devices/misc.py index c1a2ee66da..23cb05aeb4 100644 --- a/src/calibre/devices/misc.py +++ b/src/calibre/devices/misc.py @@ -48,6 +48,7 @@ class KOBO(USBMS): WINDOWS_MAIN_MEM = '.KOBOEREADER' EBOOK_DIR_MAIN = '' + SUPPORTS_SUB_DIRS = True class AVANT(USBMS): name = 'Booq Avant Device Interface' From e02d86fe906f1b01b798e59ccaa61fd766288d78 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 16 May 2010 14:42:16 -0600 Subject: [PATCH 2/5] update NIN Online. Fixes #5547 (Updated recipe for NIN online) --- resources/recipes/nin.recipe | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/resources/recipes/nin.recipe b/resources/recipes/nin.recipe index 9e1aa57733..70fd998a09 100644 --- a/resources/recipes/nin.recipe +++ b/resources/recipes/nin.recipe @@ -5,7 +5,7 @@ __copyright__ = '2008-2010, Darko Miletic ' www.nin.co.rs ''' -import re, urllib +import re from calibre import strftime from calibre.web.feeds.news import BasicNewsRecipe @@ -16,13 +16,13 @@ class Nin(BasicNewsRecipe): publisher = 'NIN d.o.o.' category = 'news, politics, Serbia' no_stylesheets = True + delay = 1 oldest_article = 15 encoding = 'utf-8' needs_subscription = True remove_empty_feeds = True PREFIX = 'http://www.nin.co.rs' INDEX = PREFIX + '/?change_lang=ls' - LOGIN = PREFIX + '/?logout=true' use_embedded_content = False language = 'sr' publication_type = 'magazine' @@ -41,14 +41,12 @@ class Nin(BasicNewsRecipe): def get_browser(self): br = BasicNewsRecipe.get_browser() - br.open(self.INDEX) if self.username is not None and self.password is not None: - data = urllib.urlencode({ 'login_name':self.username - ,'login_password':self.password - ,'imageField.x':'32' - ,'imageField.y':'15' - }) - br.open(self.LOGIN,data) + br.open(self.INDEX) + br.select_form(name='form1') + br['login_name' ] = self.username + br['login_password'] = self.password + br.submit() return br keep_only_tags =[dict(name='td', attrs={'width':'520'})] From 2bae16552c314ac7427ca48cb55e3c3943ce30bd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 16 May 2010 15:51:40 -0600 Subject: [PATCH 3/5] Agro Gerilla by Darko Miletic. Fixes #5548 (New recipe for serbian Blog Agro gerila) --- resources/recipes/agrogerila.recipe | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 resources/recipes/agrogerila.recipe diff --git a/resources/recipes/agrogerila.recipe b/resources/recipes/agrogerila.recipe new file mode 100644 index 0000000000..8ca13af4dd --- /dev/null +++ b/resources/recipes/agrogerila.recipe @@ -0,0 +1,40 @@ + +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +boljevac.blogspot.com +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class AgroGerila(BasicNewsRecipe): + title = 'Agro Gerila' + __author__ = 'Darko Miletic' + description = 'Politicki nekorektan blog.' + oldest_article = 45 + max_articles_per_feed = 100 + language = 'sr' + encoding = 'utf-8' + no_stylesheets = True + use_embedded_content = True + publication_type = 'blog' + extra_css = ' @font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{font-family: "Trebuchet MS",Trebuchet,Verdana,sans1,sans-serif} .article_description{font-family: sans1, sans-serif} img{margin-bottom: 0.8em; border: 1px solid #333333; padding: 4px } ' + + conversion_options = { + 'comment' : description + , 'tags' : 'film, blog, srbija' + , 'publisher': 'Dry-Na-Nord' + , 'language' : language + } + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + feeds = [(u'Posts', u'http://boljevac.blogspot.com/feeds/posts/default')] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return self.adeify_images(soup) + + From f21d1287e9c579a901ca29a783e66a83c2f7fabe Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 16 May 2010 18:48:59 -0600 Subject: [PATCH 4/5] Fix #5550 (unicode error in libero.recipe) --- resources/recipes/libero.recipe | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/recipes/libero.recipe b/resources/recipes/libero.recipe index f5801d06bc..4354940746 100644 --- a/resources/recipes/libero.recipe +++ b/resources/recipes/libero.recipe @@ -15,7 +15,7 @@ class LiberoNews(BasicNewsRecipe): description = 'Italian daily newspaper' cover_url = 'http://www.ilgiornale.it/img_v1/logo.gif' - title = u'Libero ' + title = u'Libero' publisher = 'EDITORIALE LIBERO s.r.l 2006' category = 'News, politics, culture, economy, general interest' @@ -48,7 +48,7 @@ class LiberoNews(BasicNewsRecipe): (u'Tecnologia', u'http://www.libero-news.it/rss.jsp?sezione=20'), (u'LifeStyle', u'http://www.libero-news.it/rss.jsp?sezione=22'), (u'Sport', u'http://www.libero-news.it/rss.jsp?sezione=23'), - (u'Costume e Società', u' http://www.libero-news.it/rss.jsp?sezione=24'), + (u'Costume e Societ\xc3\xa0', u' http://www.libero-news.it/rss.jsp?sezione=24'), (u'Milano', u'http://www.libero-news.it/rss.jsp?sezione=26'), (u'Roma', u'http://www.libero-news.it/rss.jsp?sezione=27'), (u'Alimentazione', u'http://www.libero-news.it/rss.jsp?sezione=29') From db60769702eac408d656a92f62d0e27e76bb0f68 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 16 May 2010 19:57:01 -0600 Subject: [PATCH 5/5] Don't resort when editing columns in the main GUI --- src/calibre/gui2/library.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/library.py b/src/calibre/gui2/library.py index da6b03737d..54b505867f 100644 --- a/src/calibre/gui2/library.py +++ b/src/calibre/gui2/library.py @@ -695,8 +695,8 @@ class BooksModel(QAbstractTableModel): self.db.set(row, column, val) self.emit(SIGNAL("dataChanged(QModelIndex, QModelIndex)"), \ index, index) - if column == self.sorted_on[0]: - self.resort() + #if column == self.sorted_on[0]: + # self.resort() return True