From 1acb8b2fca2fe37af7ea1e81f6018eaf20ed6503 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 14 Mar 2011 09:46:33 -0600 Subject: [PATCH 1/3] Updated rbc.ru --- resources/recipes/rbc_ru.recipe | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/resources/recipes/rbc_ru.recipe b/resources/recipes/rbc_ru.recipe index 4c377a334b..2495a195dc 100644 --- a/resources/recipes/rbc_ru.recipe +++ b/resources/recipes/rbc_ru.recipe @@ -1,24 +1,25 @@ +# -*- coding: utf-8 -*- + from calibre.web.feeds.news import BasicNewsRecipe -class AdvancedUserRecipe1286819935(BasicNewsRecipe): +class RBC_ru(BasicNewsRecipe): title = u'RBC.ru' __author__ = 'A. Chewi' - oldest_article = 7 - max_articles_per_feed = 100 + description = u'Российское информационное агентство «РосБизнесКонсалтинг» (РБК) - ленты новостей политики, экономики и финансов, аналитические материалы, комментарии и прогнозы, тематические статьи' + needs_subscription = False + cover_url = 'http://pics.rbc.ru/img/fp_v4/skin/img/logo.gif' + cover_margins = (80, 160, '#ffffff') + oldest_article = 10 + max_articles_per_feed = 50 + summary_length = 200 + remove_empty_feeds = True no_stylesheets = True + remove_javascript = True use_embedded_content = False conversion_options = {'linearize_tables' : True} - remove_attributes = ['style'] language = 'ru' timefmt = ' [%a, %d %b, %Y]' - keep_only_tags = [dict(name='h2', attrs={}), - dict(name='div', attrs={'class': 'box _ga1_on_'}), - dict(name='h1', attrs={'class': 'news_section'}), - dict(name='div', attrs={'class': 'news_body dotted_border_bottom'}), - dict(name='table', attrs={'class': 'newsBody'}), - dict(name='h2', attrs={'class': 'black'})] - feeds = [(u'Главные новости', u'http://static.feed.rbc.ru/rbc/internal/rss.rbc.ru/rbc.ru/mainnews.rss'), (u'Политика', u'http://static.feed.rbc.ru/rbc/internal/rss.rbc.ru/rbc.ru/politics.rss'), (u'Экономика', u'http://static.feed.rbc.ru/rbc/internal/rss.rbc.ru/rbc.ru/economics.rss'), @@ -26,6 +27,12 @@ class AdvancedUserRecipe1286819935(BasicNewsRecipe): (u'Происшествия', u'http://static.feed.rbc.ru/rbc/internal/rss.rbc.ru/rbc.ru/incidents.rss'), (u'Финансовые новости Quote.rbc.ru', u'http://static.feed.rbc.ru/rbc/internal/rss.rbc.ru/quote.ru/mainnews.rss')] + keep_only_tags = [dict(name='h2', attrs={}), + dict(name='div', attrs={'class': 'box _ga1_on_'}), + dict(name='h1', attrs={'class': 'news_section'}), + dict(name='div', attrs={'class': 'news_body dotted_border_bottom'}), + dict(name='table', attrs={'class': 'newsBody'}), + dict(name='h2', attrs={'class': 'black'})] remove_tags = [dict(name='div', attrs={'class': "video-frame"}), dict(name='div', attrs={'class': "photo-container videoContainer videoSWFLinks videoPreviewSlideContainer notes"}), From 4fa75a4b4a3df79fef8959fb15d2731e0c4e6057 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 14 Mar 2011 09:58:54 -0600 Subject: [PATCH 2/3] ... --- src/calibre/devices/__init__.py | 4 ++-- src/calibre/devices/prs505/driver.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/devices/__init__.py b/src/calibre/devices/__init__.py index 1918a36cc8..63b0b89a17 100644 --- a/src/calibre/devices/__init__.py +++ b/src/calibre/devices/__init__.py @@ -47,7 +47,7 @@ def get_connected_device(): for d in connected_devices: try: - d.open() + d.open(None) except: continue else: @@ -121,7 +121,7 @@ def debug(ioreg_to_tmp=False, buf=None): out('Trying to open', dev.name, '...', end=' ') try: dev.reset(detected_device=det) - dev.open() + dev.open(None) out('OK') except: import traceback diff --git a/src/calibre/devices/prs505/driver.py b/src/calibre/devices/prs505/driver.py index 9f17ea22a4..da1ef55786 100644 --- a/src/calibre/devices/prs505/driver.py +++ b/src/calibre/devices/prs505/driver.py @@ -221,7 +221,8 @@ class PRS505(USBMS): os.path.splitext(os.path.basename(p))[0], book, p) except: - debug_print('FAILED to upload cover', p) + debug_print('FAILED to upload cover', + prefix, book.lpath) else: debug_print('PRS505: NOT uploading covers in sync_booklists') From b9744d6f26be95bf4f0f98832782a6f116777219 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 14 Mar 2011 10:12:01 -0600 Subject: [PATCH 3/3] ... --- src/calibre/devices/android/driver.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/devices/android/driver.py b/src/calibre/devices/android/driver.py index 81d35cc159..0491f34d78 100644 --- a/src/calibre/devices/android/driver.py +++ b/src/calibre/devices/android/driver.py @@ -48,6 +48,7 @@ class ANDROID(USBMS): 0x04e8 : { 0x681d : [0x0222, 0x0223, 0x0224, 0x0400], 0x681c : [0x0222, 0x0224, 0x0400], 0x6640 : [0x0100], + 0x6877 : [0x0400], }, # Acer