From 9fd60f7884cde3298032ffad3ad429a8e2eafbae Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Sep 2011 08:15:33 -0600 Subject: [PATCH 1/6] ... --- src/calibre/gui2/actions/store.py | 2 +- src/calibre/translations/calibre.pot | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/actions/store.py b/src/calibre/gui2/actions/store.py index e843534c37..71f35ab16d 100644 --- a/src/calibre/gui2/actions/store.py +++ b/src/calibre/gui2/actions/store.py @@ -29,7 +29,7 @@ class StoreAction(InterfaceAction): ('book', _('book'))]: func = getattr(self, 'search_%s'%('author_title' if x == 'book' else x)) - ac = cm(x, _('Search for this %s'%t), triggered=func) + ac = cm(x, _('Search for this %s')%t, triggered=func) setattr(self, 'action_search_by_'+x, ac) self.store_menu.addSeparator() self.store_list_menu = self.store_menu.addMenu(_('Stores')) diff --git a/src/calibre/translations/calibre.pot b/src/calibre/translations/calibre.pot index 556b2f0aed..b0f8c10771 100644 --- a/src/calibre/translations/calibre.pot +++ b/src/calibre/translations/calibre.pot @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: calibre 0.8.19\n" -"POT-Creation-Date: 2011-09-16 09:55+MDT\n" -"PO-Revision-Date: 2011-09-16 09:55+MDT\n" +"POT-Creation-Date: 2011-09-17 08:14+MDT\n" +"PO-Revision-Date: 2011-09-17 08:14+MDT\n" "Last-Translator: Automatically generated\n" "Language-Team: LANGUAGE\n" "MIME-Version: 1.0\n" From 1041cc418005b7c57724e1ca5bbd0d89b4b06802 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Sep 2011 08:17:11 -0600 Subject: [PATCH 2/6] ... --- src/calibre/web/jsbrowser/browser.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/calibre/web/jsbrowser/browser.py b/src/calibre/web/jsbrowser/browser.py index 6a87594030..133d720aac 100644 --- a/src/calibre/web/jsbrowser/browser.py +++ b/src/calibre/web/jsbrowser/browser.py @@ -175,6 +175,14 @@ class NetworkAccessManager(QNetworkAccessManager): # {{{ class Browser(QObject): + ''' + Browser (WebKit with no GUI). + + This browser is NOT thread safe. Use it in a single thread only! If you + need to run downloads in parallel threads, use multiple browsers (after + copying the cookies). + ''' + def __init__(self, # Logging. If None, uses a default log, which does not output # debugging info @@ -216,6 +224,3 @@ class Browser(QObject): self.nam = NetworkAccessManager(log, use_disk_cache=use_disk_cache, parent=self) self.page.setNetworkAccessManager(self.nam) - def visit(self, url): - pass - From ac747892ccc4ba64b618289a0a82bb3569253e37 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Sep 2011 08:27:02 -0600 Subject: [PATCH 3/6] Fix #852481 (Untranslatable strings) --- src/calibre/gui2/dialogs/check_library.py | 6 +-- src/calibre/translations/calibre.pot | 50 ++++++++++++++++------- 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/src/calibre/gui2/dialogs/check_library.py b/src/calibre/gui2/dialogs/check_library.py index 95f99d4034..d87ad7041f 100644 --- a/src/calibre/gui2/dialogs/check_library.py +++ b/src/calibre/gui2/dialogs/check_library.py @@ -229,14 +229,14 @@ class CheckLibraryDialog(QDialog): self.copy_button = QPushButton(_('Copy &to clipboard')) self.copy_button.setDefault(False) self.copy_button.clicked.connect(self.copy_to_clipboard) - self.ok_button = QPushButton('&Done') + self.ok_button = QPushButton(_('&Done')) self.ok_button.setDefault(True) self.ok_button.clicked.connect(self.accept) - self.delete_button = QPushButton('Delete &marked') + self.delete_button = QPushButton(_('Delete &marked')) self.delete_button.setToolTip(_('Delete marked files (checked subitems)')) self.delete_button.setDefault(False) self.delete_button.clicked.connect(self.delete_marked) - self.fix_button = QPushButton('&Fix marked') + self.fix_button = QPushButton(_('&Fix marked')) self.fix_button.setDefault(False) self.fix_button.setEnabled(False) self.fix_button.setToolTip(_('Fix marked sections (checked fixable items)')) diff --git a/src/calibre/translations/calibre.pot b/src/calibre/translations/calibre.pot index b0f8c10771..dc07142791 100644 --- a/src/calibre/translations/calibre.pot +++ b/src/calibre/translations/calibre.pot @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: calibre 0.8.19\n" -"POT-Creation-Date: 2011-09-17 08:14+MDT\n" -"PO-Revision-Date: 2011-09-17 08:14+MDT\n" +"POT-Creation-Date: 2011-09-17 08:26+MDT\n" +"PO-Revision-Date: 2011-09-17 08:26+MDT\n" "Last-Translator: Automatically generated\n" "Language-Team: LANGUAGE\n" "MIME-Version: 1.0\n" @@ -150,7 +150,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/add_empty_book.py:68 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/book_info.py:128 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/comicconf.py:47 -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:775 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:777 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:372 #: /home/kovid/work/calibre/src/calibre/gui2/email.py:185 #: /home/kovid/work/calibre/src/calibre/gui2/email.py:200 @@ -4017,7 +4017,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/actions/choose_library.py:383 #: /home/kovid/work/calibre/src/calibre/gui2/actions/copy_to_library.py:194 #: /home/kovid/work/calibre/src/calibre/gui2/device.py:745 -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:968 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:970 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/restore_library.py:101 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/tweaks.py:337 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/tweaks.py:377 @@ -7233,10 +7233,22 @@ msgstr "" msgid "Copy &to clipboard" msgstr "" +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/check_library.py:232 +msgid "&Done" +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/check_library.py:235 +msgid "Delete &marked" +msgstr "" + #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/check_library.py:236 msgid "Delete marked files (checked subitems)" msgstr "" +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/check_library.py:239 +msgid "&Fix marked" +msgstr "" + #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/check_library.py:242 msgid "Fix marked sections (checked fixable items)" msgstr "" @@ -7806,49 +7818,49 @@ msgstr "" msgid "S/R TEMPLATE ERROR" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:658 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:660 msgid "You must specify a destination when source is a composite field" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:664 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:666 msgid "You must specify a destination identifier type" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:899 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:901 msgid "Search/replace invalid" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:900 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:902 #, python-format msgid "Search pattern is invalid: %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:954 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:956 #, python-format msgid "" "Applying changes to %d books.\n" "Phase {0} {1}%%." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:984 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:986 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk_ui.py:600 msgid "Delete saved search/replace" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:985 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:987 msgid "The selected saved search/replace will be deleted. Are you sure?" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:1002 -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:1010 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:1004 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:1012 msgid "Save search/replace" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:1003 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:1005 msgid "Search/replace name:" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:1011 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk.py:1013 msgid "That saved search/replace already exists and will be overwritten. Are you sure?" msgstr "" @@ -16011,6 +16023,14 @@ msgstr "" msgid "days_between(date1, date2) -- return the number of days between date1 and date2. The number is positive if date1 is greater than date2, otherwise negative. If either date1 or date2 are not dates, the function returns the empty string." msgstr "" +#: /home/kovid/work/calibre/src/calibre/utils/formatter_functions.py:1005 +msgid "language_strings(lang_codes, localize) -- return the strings for the language codes passed in lang_codes. If localize is zero, return the strings in English. If localize is not zero, return the strings in the language of the current locale. Lang_codes is a comma-separated list." +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/utils/formatter_functions.py:1025 +msgid "language_codes(lang_strings) -- return the language codes for the strings passed in lang_strings. The strings must be in the language of the current locale. Lang_strings is a comma-separated list." +msgstr "" + #: /home/kovid/work/calibre/src/calibre/utils/ipc/job.py:43 msgid "Waiting..." msgstr "" From 33c3d838581eb56e294c81f409d97e36169d8930 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Sep 2011 08:44:31 -0600 Subject: [PATCH 4/6] ... --- src/calibre/manual/faq.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index bd4c0f51c7..92867fac7a 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -117,9 +117,9 @@ We just need some information from you: * What ebook formats does your device support? * Is there a special directory on the device in which all ebook files should be placed? * We also need information about your device that |app| will collect automatically. First, if your - device supports SD cards, insert them. Then connect your device. In calibre go to :guilabel:`Preferences->Advanced->Miscellaneous` + device supports SD cards, insert them. Then connect your device to the computer. In calibre go to :guilabel:`Preferences->Advanced->Miscellaneous` and click the "Debug device detection" button. This will create some debug output. Copy it to a file - and repeat the process, this time with your device disconnected. + and repeat the process, this time with your device disconnected from your computer. * Send both the above outputs to us with the other information and we will write a device driver for your device. From 59fabea9f9fe2be76b7a56047dd03cdacef86e8b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Sep 2011 12:29:33 -0600 Subject: [PATCH 5/6] MOBI Output: Don't set cdetype when share_not_sync is specified. --- src/calibre/ebooks/metadata/mobi.py | 2 +- src/calibre/ebooks/mobi/writer2/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/metadata/mobi.py b/src/calibre/ebooks/metadata/mobi.py index 2da9f74961..c9c7d80902 100644 --- a/src/calibre/ebooks/metadata/mobi.py +++ b/src/calibre/ebooks/metadata/mobi.py @@ -360,7 +360,7 @@ class MetadataUpdater(object): if kindle_pdoc and kindle_pdoc in mi.tags: added_501 = True - update_exth_record((501, str('PDOC'))) + update_exth_record((501, b'PDOC')) if mi.pubdate: update_exth_record((106, str(mi.pubdate).encode(self.codec, 'replace'))) diff --git a/src/calibre/ebooks/mobi/writer2/main.py b/src/calibre/ebooks/mobi/writer2/main.py index 1705a5a342..4339532ee3 100644 --- a/src/calibre/ebooks/mobi/writer2/main.py +++ b/src/calibre/ebooks/mobi/writer2/main.py @@ -535,7 +535,7 @@ class MobiWriter(object): nrecs += 1 # Write cdetype - if not self.is_periodical: + if not self.is_periodical and not self.opts.share_not_sync: exth.write(pack(b'>II', 501, 12)) exth.write(b'EBOK') nrecs += 1 From ad0cd870d3a4d1ddabb0019dbfd0b9e267fe685c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Sep 2011 14:24:33 -0600 Subject: [PATCH 6/6] Fix Cicero --- recipes/cicero.recipe | 63 ++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/recipes/cicero.recipe b/recipes/cicero.recipe index 2df6b68000..de6676ae44 100644 --- a/recipes/cicero.recipe +++ b/recipes/cicero.recipe @@ -1,35 +1,38 @@ from calibre.web.feeds.news import BasicNewsRecipe -class Cicero(BasicNewsRecipe): - timefmt = ' [%Y-%m-%d]' - title = u'Cicero' - __author__ = 'mad@sharktooth.de' - description = u'Magazin f\xfcr politische Kultur' - oldest_article = 7 - language = 'de' +class BasicUserRecipe1316245412(BasicNewsRecipe): + + title = u'Cicero Online' + description = u'Magazin f\xfcr politische Kultur' + publisher = 'Ringier Publishing GmbH' + category = 'news, politics, Germany' + language = 'de' + encoding = 'UTF-8' + __author__ = 'Armin Geller' # 2011-09-17 + + oldest_article = 7 max_articles_per_feed = 100 - no_stylesheets = True - use_embedded_content = False - publisher = 'Ringier Publishing' - category = 'news, politics, Germany' - encoding = 'iso-8859-1' - publication_type = 'magazine' - masthead_url = 'http://www.cicero.de/img2/cicero_logo_rss.gif' - feeds = [ -(u'Das gesamte Portfolio', u'http://www.cicero.de/rss/rss.php?ress_id='), -#(u'Alle Heft-Inhalte', u'http://www.cicero.de/rss/rss.php?ress_id=heft'), -#(u'Alle Online-Inhalte', u'http://www.cicero.de/rss/rss.php?ress_id=online'), -#(u'Berliner Republik', u'http://www.cicero.de/rss/rss.php?ress_id=4'), -#(u'Weltb\xfchne', u'http://www.cicero.de/rss/rss.php?ress_id=1'), -#(u'Salon', u'http://www.cicero.de/rss/rss.php?ress_id=7'), -#(u'Kapital', u'http://www.cicero.de/rss/rss.php?ress_id=6'), -#(u'Netzst\xfccke', u'http://www.cicero.de/rss/rss.php?ress_id=9'), -#(u'Leinwand', u'http://www.cicero.de/rss/rss.php?ress_id=12'), -#(u'Bibliothek', u'http://www.cicero.de/rss/rss.php?ress_id=15'), -(u'Kolumne - Alle Kolulmnen', u'http://www.cicero.de/rss/rss2.php?ress_id='), -#(u'Kolumne - Schreiber, Berlin', u'http://www.cicero.de/rss/rss2.php?ress_id=35'), -#(u'Kolumne - TV Kritik', u'http://www.cicero.de/rss/rss2.php?ress_id=34') -] + no_stylesheets = True + auto_cleanup = False + + remove_tags = [ + dict(name='div', attrs={'id':["header", "navigation", "skip-link", "header-print", "header-print-url", "meta-toolbar", "footer"]}), + dict(name='div', attrs={'class':["region region-sidebar-first column sidebar", "breadcrumb", "breadcrumb-title", "meta", "comment-wrapper", + "field field-name-field-show-teaser-right field-type-list-boolean field-label-above"]}), + dict(name='div', attrs={'title':["Dossier Auswahl"]}), + dict(name='h2', attrs={'class':["title comment-form"]}), + dict(name='form', attrs={'class':["comment-form user-info-from-cookie"]}), + ] + + feeds = [ + (u'Das gesamte Portfolio', u'http://www.cicero.de/rss.xml'), + (u'Berliner Republik', u'http://www.cicero.de/berliner-republik.xml'), + (u'Weltb\xfchne', u'http://www.cicero.de/weltbuehne.xml'), + (u'Kapital', u'http://www.cicero.de/kapital.xml'), + (u'Salon', u'http://www.cicero.de/salon.xml'), + (u'Blogs', u'http://www.cicero.de/blogs.xml'), #seems not to be in use at the moment + ] def print_version(self, url): - return 'http://www.cicero.de/page_print.php?' + url.rpartition('?')[2] + return url + '?print' +