From 583685933d00d9f8d58f684f3315164d20a56f4e Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sun, 8 May 2011 18:04:23 +0200 Subject: [PATCH 1/5] Fixed by ensuring the dates are in local time instead of UTC --- src/calibre/gui2/metadata/basic_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py index 8858f9c986..d662256def 100644 --- a/src/calibre/gui2/metadata/basic_widgets.py +++ b/src/calibre/gui2/metadata/basic_widgets.py @@ -1126,7 +1126,7 @@ class DateEdit(QDateEdit): # {{{ @dynamic_property def current_val(self): def fget(self): - return qt_to_dt(self.date()) + return qt_to_dt(self.date(), as_utc=False) def fset(self, val): if val is None: val = UNDEFINED_DATE From cd6f43c13fd705a9f9a8f1689749f18bb05de59b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 8 May 2011 17:06:14 -0600 Subject: [PATCH 2/5] Fix #779560 (iPad2 device ID not supported by apple driver) --- src/calibre/devices/apple/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/devices/apple/driver.py b/src/calibre/devices/apple/driver.py index cd0bbe2ace..922afc4338 100644 --- a/src/calibre/devices/apple/driver.py +++ b/src/calibre/devices/apple/driver.py @@ -205,7 +205,7 @@ class ITUNES(DriverBase): # 0x129a iPad # 0x12a2 iPad2 VENDOR_ID = [0x05ac] - PRODUCT_ID = [0x1292,0x1293,0x1294,0x1297,0x1299,0x129a,0x12a2] + PRODUCT_ID = [0x1292,0x1293,0x1294,0x1297,0x1299,0x129a,0x129f,0x12a2] BCD = [0x01] # Plugboard ID From a558cd0d2a5f88fe8a0e0c84896857a790c7ec8e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 8 May 2011 17:37:46 -0600 Subject: [PATCH 3/5] Ignore 'Unknown' author when downloading metadata. Fixes #779348 (metadata fails on unknown author) --- src/calibre/ebooks/metadata/sources/amazon.py | 2 +- src/calibre/ebooks/metadata/sources/base.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/amazon.py b/src/calibre/ebooks/metadata/sources/amazon.py index 8483698e28..31d815af63 100644 --- a/src/calibre/ebooks/metadata/sources/amazon.py +++ b/src/calibre/ebooks/metadata/sources/amazon.py @@ -338,7 +338,7 @@ class Amazon(Source): q['field-author'] = ' '.join(author_tokens) if not ('field-keywords' in q or 'field-isbn' in q or - ('field-title' in q and 'field-author' in q)): + ('field-title' in q)): # Insufficient metadata to make an identify query return None diff --git a/src/calibre/ebooks/metadata/sources/base.py b/src/calibre/ebooks/metadata/sources/base.py index e74e4f5042..c20cb1db83 100644 --- a/src/calibre/ebooks/metadata/sources/base.py +++ b/src/calibre/ebooks/metadata/sources/base.py @@ -291,10 +291,10 @@ class Source(Plugin): parts = parts[1:] + parts[:1] for tok in parts: tok = remove_pat.sub('', tok).strip() - if len(tok) > 2 and tok.lower() not in ('von', ): + if len(tok) > 2 and tok.lower() not in ('von', 'van', + _('Unknown').lower()): yield tok - def get_title_tokens(self, title, strip_joiners=True, strip_subtitle=False): ''' Take a title and return a list of tokens useful for an AND search query. From d995b59ce5b523f713f93d1ffc1960937ddec1d6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 May 2011 08:42:55 -0600 Subject: [PATCH 4/5] Updated Telepolis --- recipes/telepolis.recipe | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/recipes/telepolis.recipe b/recipes/telepolis.recipe index 8109e3e39a..3611ebc642 100644 --- a/recipes/telepolis.recipe +++ b/recipes/telepolis.recipe @@ -1,17 +1,12 @@ # -*- coding: utf-8 -*- -__license__ = 'GPL v3' -__copyright__ = '2009, Gerhard Aigner ' - - -import re from calibre.web.feeds.news import BasicNewsRecipe class TelepolisNews(BasicNewsRecipe): title = u'Telepolis (News+Artikel)' - __author__ = 'Gerhard Aigner' + __author__ = 'syntaxis' publisher = 'Heise Zeitschriften Verlag GmbH & Co KG' - description = 'News from telepolis' + description = 'News from Telepolis' category = 'news' oldest_article = 7 max_articles_per_feed = 100 @@ -20,14 +15,19 @@ class TelepolisNews(BasicNewsRecipe): encoding = "utf-8" language = 'de' - use_embedded_content =False + remove_empty_feeds = True - preprocess_regexps = [(re.compile(r']*>', re.DOTALL|re.IGNORECASE), lambda match: ''), - (re.compile(r'', re.DOTALL|re.IGNORECASE), lambda match: ''),] - keep_only_tags = [dict(name = 'td',attrs={'class':'bloghead'}),dict(name = 'td',attrs={'class':'blogfliess'})] - remove_tags = [dict(name='img'), dict(name='td',attrs={'class':'blogbottom'}), dict(name='td',attrs={'class':'forum'})] + + keep_only_tags = [dict(name = 'div',attrs={'class':'head'}),dict(name = 'div',attrs={'class':'leftbox'}),dict(name='td',attrs={'class':'strict'})] + remove_tags = [ dict(name='td',attrs={'class':'blogbottom'}), + dict(name='div',attrs={'class':'forum'}), dict(name='div',attrs={'class':'social'}),dict(name='div',attrs={'class':'blog-letter p-news'}), + dict(name='div',attrs={'class':'blog-sub'}),dict(name='div',attrs={'class':'version-div'}),dict(name='div',attrs={'id':'breadcrumb'}) + ,dict(attrs={'class':'tp-url'}),dict(attrs={'class':'blog-name entry_'}) ] + + remove_tags_after = [dict(name='span', attrs={'class':['breadcrumb']})] + feeds = [(u'News', u'http://www.heise.de/tp/news-atom.xml')] @@ -39,15 +39,8 @@ class TelepolisNews(BasicNewsRecipe): html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' - def get_article_url(self, article): - '''if the linked article is of kind artikel don't take it''' - if (article.link.count('artikel') > 1) : - return None - return article.link def preprocess_html(self, soup): mtag = '' soup.head.insert(0,mtag) return soup - - From 6610a6ae4abe3ff9ff37e4fce03885153cd207f6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 May 2011 09:03:50 -0600 Subject: [PATCH 5/5] Add Ziua Veche by Silviu Cotoara --- recipes/icons/ziuaveche.png | Bin 0 -> 554 bytes recipes/ziuaveche.recipe | 53 ++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 recipes/icons/ziuaveche.png create mode 100644 recipes/ziuaveche.recipe diff --git a/recipes/icons/ziuaveche.png b/recipes/icons/ziuaveche.png new file mode 100644 index 0000000000000000000000000000000000000000..91152b01eebb841025ddad4c88c68610d07f75fe GIT binary patch literal 554 zcmV+_0@eMAP) zUy?q%E32N!Yir2O&m({3DstDa0i{WIWDKG_$h1D$1We!>`rF$;BA8fQ1k4!t s>?sJqzW*?M6Vd1!`R8T+2Mhpz0Py&o=d{A2MF0Q*07*qoM6N<$g5NItGynhq literal 0 HcmV?d00001 diff --git a/recipes/ziuaveche.recipe b/recipes/ziuaveche.recipe new file mode 100644 index 0000000000..61df768e0a --- /dev/null +++ b/recipes/ziuaveche.recipe @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +ziuaveche.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class ZiuaVeche(BasicNewsRecipe): + title = u'Ziua Veche' + __author__ = u'Silviu Cotoar\u0103' + description = 'Cotidian online' + publisher = 'Ziua Veche' + oldest_article = 5 + language = 'ro' + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + category = 'Ziare,Cotidiane,Stiri' + encoding = 'utf-8' + cover_url = 'http://www.ziuaveche.ro/wp-content/themes/tema/images/zv-logo-alb-old.png' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + + keep_only_tags = [ + dict(name='div', attrs={'id':'singlePost'}) + + ] + + remove_tags = [ + dict(name='div', attrs={'id':'LikePluginPagelet'}) + + ] + + remove_tags_after = [ + dict(name='div', attrs={'id':'LikePluginPagelet'}) + ] + + feeds = [ + (u'Feeds', u'http://www.ziuaveche.ro/feed/rss') + ] + + def preprocess_html(self, soup): + return self.adeify_images(soup)