From 467f0be76fa62b16c526119a4da15044bda7d14b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Sun, 10 Jun 2012 12:12:26 +0200 Subject: [PATCH 01/12] draft version of improved virtualo plugin --- .../gui2/store/stores/virtualo_plugin.py | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/calibre/gui2/store/stores/virtualo_plugin.py b/src/calibre/gui2/store/stores/virtualo_plugin.py index e1d86b4d8b..f88ed9e96b 100644 --- a/src/calibre/gui2/store/stores/virtualo_plugin.py +++ b/src/calibre/gui2/store/stores/virtualo_plugin.py @@ -40,29 +40,25 @@ class VirtualoStore(BasicStoreConfig, StorePlugin): url = 'http://virtualo.pl/?q=' + urllib.quote(query) + '&f=format_id:4,6,3' br = browser() - drm_pattern = re.compile("ADE") + no_drm_pattern = re.compile("Znak wodny") counter = max_results with closing(br.open(url, timeout=timeout)) as f: doc = html.fromstring(f.read()) - for data in doc.xpath('//div[@id="product_list"]/div/div[@class="column"]'): + for data in doc.xpath('//div[@id="content"]//div[@class="list_box list_box_border"]'): if counter <= 0: break - id = ''.join(data.xpath('.//table/tr[1]/td[1]/a/@href')) + id = ''.join(data.xpath('.//div[@class="list_middle_left"]//a/@href')) if not id: continue price = ''.join(data.xpath('.//span[@class="price"]/text() | .//span[@class="price abbr"]/text()')) - cover_url = ''.join(data.xpath('.//table/tr[1]/td[1]/a/img/@src')) - title = ''.join(data.xpath('.//div[@class="title"]/a/text()')) - title = re.sub(r'\ WM', '', title) - author = ', '.join(data.xpath('.//div[@class="authors"]/a/text()')) - formats = ', '.join(data.xpath('.//span[@class="format"]/a/text()')) - formats = re.sub(r'(, )?ONLINE(, )?', '', formats) - drm = drm_pattern.search(formats) - formats = re.sub(r'(, )?ADE(, )?', '', formats) - formats = re.sub(r'\ WM', '', formats) + cover_url = ''.join(data.xpath('.//div[@class="list_middle_left"]//a/img/@src')) + title = ''.join(data.xpath('.//div[@class="list_title list_text_left"]/a/text()')) + author = ', '.join(data.xpath('.//div[@class="list_authors list_text_left"]/a/text()')) + formats = ', '#.join(data.xpath('.//div[2]/div[3]//div[@class="list_vertical_wrap_middle"]/img/@src()')) + drm = not no_drm_pattern.search(formats) counter -= 1 From b514803f43cb29a665651621bd58ab78967e4243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Sun, 10 Jun 2012 15:57:22 +0200 Subject: [PATCH 02/12] virtualo plugin catches up with website upgrade --- src/calibre/gui2/store/stores/virtualo_plugin.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/store/stores/virtualo_plugin.py b/src/calibre/gui2/store/stores/virtualo_plugin.py index f88ed9e96b..e6b60fbe91 100644 --- a/src/calibre/gui2/store/stores/virtualo_plugin.py +++ b/src/calibre/gui2/store/stores/virtualo_plugin.py @@ -57,18 +57,18 @@ class VirtualoStore(BasicStoreConfig, StorePlugin): cover_url = ''.join(data.xpath('.//div[@class="list_middle_left"]//a/img/@src')) title = ''.join(data.xpath('.//div[@class="list_title list_text_left"]/a/text()')) author = ', '.join(data.xpath('.//div[@class="list_authors list_text_left"]/a/text()')) - formats = ', '#.join(data.xpath('.//div[2]/div[3]//div[@class="list_vertical_wrap_middle"]/img/@src()')) - drm = not no_drm_pattern.search(formats) + formats = [ form.split('_')[-1].replace('.png', '') for form in data.xpath('.//div[@style="width:55%;float:left;text-align:left;height:18px;"]//img/@src')] + nodrm = no_drm_pattern.search(''.join(data.xpath('.//div[@style="width:45%;float:right;text-align:right;height:18px;"]/div/div/text()'))) counter -= 1 s = SearchResult() s.cover_url = cover_url.split('.jpg')[0] + '.jpg' - s.title = title.strip() + ' ' + formats + s.title = title.strip() s.author = author.strip() s.price = price + ' zł' s.detail_item = 'http://virtualo.pl' + id.strip().split('http://')[0] - s.formats = formats.upper().strip() - s.drm = SearchResult.DRM_LOCKED if drm else SearchResult.DRM_UNLOCKED + s.formats = ', '.join(formats).upper() + s.drm = SearchResult.DRM_UNLOCKED if nodrm else SearchResult.DRM_UNKNOWN yield s From 1a2a042ed5b6ddc91762b64a303ab2d75305208a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 12 Jun 2012 19:37:04 +0530 Subject: [PATCH 03/12] Fix #1012069 (Impossible to make right translation) --- src/calibre/gui2/actions/store.py | 6 +- src/calibre/translations/calibre.pot | 531 ++++++++++++++------------- 2 files changed, 279 insertions(+), 258 deletions(-) diff --git a/src/calibre/gui2/actions/store.py b/src/calibre/gui2/actions/store.py index 71f35ab16d..adc66edea4 100644 --- a/src/calibre/gui2/actions/store.py +++ b/src/calibre/gui2/actions/store.py @@ -25,11 +25,11 @@ class StoreAction(InterfaceAction): self.qaction.triggered.connect(self.do_search) self.store_menu = self.qaction.menu() cm = partial(self.create_menu_action, self.store_menu) - for x, t in [('author', _('author')), ('title', _('title')), - ('book', _('book'))]: + for x, t in [('author', _('this author')), ('title', _('this title')), + ('book', _('this 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 %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 45e28f95dc..87e8f91e90 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.55\n" -"POT-Creation-Date: 2012-06-08 10:22+IST\n" -"PO-Revision-Date: 2012-06-08 10:22+IST\n" +"POT-Creation-Date: 2012-06-12 19:36+IST\n" +"PO-Revision-Date: 2012-06-12 19:36+IST\n" "Last-Translator: Automatically generated\n" "Language-Team: LANGUAGE\n" "MIME-Version: 1.0\n" @@ -24,8 +24,8 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/db/cache.py:106 #: /home/kovid/work/calibre/src/calibre/db/cache.py:109 #: /home/kovid/work/calibre/src/calibre/db/cache.py:120 -#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:326 #: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:327 +#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:328 #: /home/kovid/work/calibre/src/calibre/devices/hanvon/driver.py:100 #: /home/kovid/work/calibre/src/calibre/devices/hanvon/driver.py:101 #: /home/kovid/work/calibre/src/calibre/devices/jetbook/driver.py:74 @@ -63,6 +63,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/book/base.py:499 #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/book/base.py:731 #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/book/base.py:770 +#: /home/kovid/work/calibre/src/calibre/ebooks/metadata/docx.py:64 #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/ereader.py:36 #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/ereader.py:61 #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/extz.py:23 @@ -181,15 +182,15 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/viewer/main.py:178 #: /home/kovid/work/calibre/src/calibre/library/cli.py:235 #: /home/kovid/work/calibre/src/calibre/library/database.py:914 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:561 #: /home/kovid/work/calibre/src/calibre/library/database2.py:569 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:580 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:2090 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:2244 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:2660 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:3308 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:3310 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:3447 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:577 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:588 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:2098 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:2252 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:2668 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:3316 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:3318 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:3455 #: /home/kovid/work/calibre/src/calibre/library/server/content.py:250 #: /home/kovid/work/calibre/src/calibre/library/server/content.py:251 #: /home/kovid/work/calibre/src/calibre/library/server/mobile.py:245 @@ -285,348 +286,349 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:273 #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:283 #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:293 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:304 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:316 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:337 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:348 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:303 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:314 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:326 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:347 #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:358 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:369 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:368 #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:379 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:390 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:389 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:400 #, python-format msgid "Read metadata from %s files" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:327 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:337 msgid "Read metadata from ebooks in RAR archives" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:401 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:411 msgid "Read metadata from ebooks in ZIP archives" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:418 #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:428 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:449 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:438 #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:459 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:481 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:492 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:469 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:491 #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:502 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:512 #, python-format msgid "Set metadata in %s files" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:438 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:470 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:513 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:448 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:480 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:523 #, python-format msgid "Set metadata from %s files" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:761 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:771 msgid "Add books to calibre or the connected device" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:766 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:776 msgid "Fetch annotations from a connected Kindle (experimental)" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:771 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:781 msgid "Generate a catalog of the books in your calibre library" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:776 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:786 msgid "Convert books to various ebook formats" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:781 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:791 msgid "Delete books from your calibre library or connected device" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:786 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:796 msgid "Edit the metadata of books in your calibre library" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:791 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:801 msgid "Read books in your calibre library" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:796 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:806 msgid "Download news from the internet in ebook form" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:801 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:811 msgid "Show a list of related books quickly" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:806 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:816 msgid "Export books from your calibre library to the hard disk" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:811 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:821 msgid "Show book details in a separate popup" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:816 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:826 msgid "Restart calibre" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:821 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:831 msgid "Open the folder that contains the book files in your calibre library" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:827 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:837 msgid "Send books to the connected device" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:832 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:842 msgid "Send books via email or the web also connect to iTunes or folders on your computer as if they are devices" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:838 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:848 #: /home/kovid/work/calibre/src/calibre/gui2/actions/help.py:16 msgid "Browse the calibre User Manual" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:843 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:853 msgid "Customize calibre" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:848 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:858 msgid "Easily find books similar to the currently selected one" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:853 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:863 msgid "Switch between different calibre libraries and perform maintenance on them" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:859 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:869 msgid "Copy books from the devce to your calibre library" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:864 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:874 msgid "Edit the collections in which books are placed on your device" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:869 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:879 msgid "Copy a book from one calibre library to another" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:874 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:884 msgid "Make small tweaks to epub or htmlz files in your calibre library" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:879 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:889 msgid "Find the next or previous match when searching in your calibre library in highlight mode" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:885 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:895 msgid "Choose a random book from your calibre library" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:892 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:902 msgid "Search for books from different book sellers" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:908 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:918 msgid "Get new calibre plugins or update your existing ones" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:927 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:937 msgid "Look and Feel" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:929 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:941 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:952 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:963 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:975 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:939 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:951 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:962 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:973 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:985 msgid "Interface" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:933 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:943 msgid "Adjust the look and feel of the calibre interface to suit your tastes" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:939 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:949 msgid "Behavior" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:945 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:955 msgid "Change the way calibre behaves" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:950 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:960 #: /home/kovid/work/calibre/src/calibre/gui2/library/views.py:267 msgid "Add your own columns" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:956 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:966 msgid "Add/remove your own columns to the calibre book list" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:961 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:971 msgid "Toolbar" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:967 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:977 msgid "Customize the toolbars and context menus, changing which actions are available in each" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:973 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:983 msgid "Searching" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:979 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:989 msgid "Customize the way searching for books works in calibre" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:984 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:994 msgid "Input Options" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:986 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:997 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1008 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:996 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1007 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1018 msgid "Conversion" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:990 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1000 msgid "Set conversion options specific to each input format" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:995 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1005 msgid "Common Options" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1001 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1011 msgid "Set conversion options common to all formats" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1006 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1016 msgid "Output Options" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1012 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1022 msgid "Set conversion options specific to each output format" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1017 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1027 msgid "Adding books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1019 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1031 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1043 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1055 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1029 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1041 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1053 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1065 msgid "Import/Export" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1023 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1033 msgid "Control how calibre reads metadata from files when adding books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1029 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1039 msgid "Saving books to disk" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1035 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1045 msgid "Control how calibre exports files from its database to disk when using Save to disk" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1041 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1051 msgid "Sending books to devices" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1047 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1057 msgid "Control how calibre transfers files to your ebook reader" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1053 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1063 msgid "Metadata plugboards" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1059 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1069 msgid "Change metadata fields before saving/sending" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1064 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1074 msgid "Template Functions" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1066 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1113 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1125 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1136 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1147 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1076 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1123 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1135 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1146 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1157 msgid "Advanced" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1070 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1080 msgid "Create your own template functions" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1075 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1085 msgid "Sharing books by email" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1077 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1089 -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1102 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1087 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1099 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1112 msgid "Sharing" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1081 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1091 msgid "Setup sharing of books via email. Can be used for automatic sending of downloaded news to your devices" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1087 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1097 msgid "Sharing over the net" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1093 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1103 msgid "Setup the calibre Content Server which will give you access to your calibre library from anywhere, on any device, over the internet" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1100 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1110 msgid "Metadata download" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1106 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1116 msgid "Control how calibre downloads ebook metadata from the net" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1111 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1121 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/plugins.py:292 msgid "Plugins" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1117 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1127 msgid "Add/remove/customize various bits of calibre functionality" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1123 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1133 msgid "Tweaks" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1129 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1139 msgid "Fine tune how calibre behaves in various contexts" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1134 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1144 msgid "Keyboard" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1140 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1150 msgid "Customize the keyboard shortcuts used by calibre" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1145 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1155 #: /home/kovid/work/calibre/src/calibre/gui2/keyboard.py:110 msgid "Miscellaneous" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1151 +#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:1161 msgid "Miscellaneous advanced configuration" msgstr "" @@ -868,26 +870,26 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/book/base.py:666 #: /home/kovid/work/calibre/src/calibre/gui2/custom_column_widgets.py:67 #: /home/kovid/work/calibre/src/calibre/gui2/custom_column_widgets.py:683 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:1015 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:1023 #: /home/kovid/work/calibre/src/calibre/utils/formatter_functions.py:844 #: /home/kovid/work/calibre/src/calibre/utils/formatter_functions.py:867 msgid "Yes" msgstr "" #: /home/kovid/work/calibre/src/calibre/db/fields.py:163 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:1146 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:1154 msgid "Main" msgstr "" #: /home/kovid/work/calibre/src/calibre/db/fields.py:165 #: /home/kovid/work/calibre/src/calibre/gui2/layout.py:77 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:1148 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:1156 msgid "Card A" msgstr "" #: /home/kovid/work/calibre/src/calibre/db/fields.py:167 #: /home/kovid/work/calibre/src/calibre/gui2/layout.py:79 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:1150 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:1158 msgid "Card B" msgstr "" @@ -899,15 +901,15 @@ msgstr "" msgid "Communicate with Android phones." msgstr "" -#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:174 +#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:175 msgid "Comma separated list of directories to send e-books to on the device. The first one that exists will be used" msgstr "" -#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:266 +#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:267 msgid "Communicate with S60 phones." msgstr "" -#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:285 +#: /home/kovid/work/calibre/src/calibre/devices/android/driver.py:286 msgid "Communicate with WebOS tablets." msgstr "" @@ -1016,9 +1018,9 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:469 #: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/model.py:1173 #: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/model.py:1175 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:346 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:359 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:3165 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:354 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:367 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:3173 #: /home/kovid/work/calibre/src/calibre/library/field_metadata.py:187 msgid "News" msgstr "" @@ -1026,8 +1028,8 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/devices/apple/driver.py:2727 #: /home/kovid/work/calibre/src/calibre/gui2/catalog/catalog_epub_mobi.py:65 #: /home/kovid/work/calibre/src/calibre/library/catalogs/epub_mobi.py:65 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:3121 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:3139 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:3129 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:3147 msgid "Catalog" msgstr "" @@ -4977,20 +4979,21 @@ msgid "Search for ebooks" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/actions/store.py:28 -msgid "author" +msgid "this author" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/actions/store.py:28 -msgid "title" +msgid "this title" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/actions/store.py:29 -msgid "book" +msgid "this book" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/actions/store.py:32 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:430 #, python-format -msgid "Search for this %s" +msgid "Search for %s" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/actions/store.py:35 @@ -5394,7 +5397,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles_ui.py:277 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles_ui.py:279 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles_ui.py:280 -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:154 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:158 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/behavior_ui.py:166 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/behavior_ui.py:167 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/columns_ui.py:89 @@ -5407,7 +5410,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/custom_columns_ui.py:87 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/custom_columns_ui.py:89 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/custom_columns_ui.py:90 -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:127 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:182 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/toolbar_ui.py:63 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/toolbar_ui.py:74 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/toolbar_ui.py:103 @@ -5575,7 +5578,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/device_drivers/configwidget_ui.py:77 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/search_item_ui.py:40 #: /home/kovid/work/calibre/src/calibre/gui2/filename_pattern_ui.py:128 -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:118 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:122 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/behavior_ui.py:146 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/columns_ui.py:86 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/conversion_ui.py:54 @@ -5588,7 +5591,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/plugins_ui.py:108 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/save_template_ui.py:56 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/saving_ui.py:21 -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:109 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:164 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/sending_ui.py:68 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/server_ui.py:138 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/template_functions_ui.py:95 @@ -6995,7 +6998,7 @@ msgid "Save this list of expressions so that you can re-use it easily" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/convert/search_and_replace_ui.py:157 -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:131 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:186 #: /usr/src/qt-everywhere-opensource-src-4.8.0/src/gui/widgets/qdialogbuttonbox.cpp:661 msgid "&Save" msgstr "" @@ -11447,27 +11450,27 @@ msgstr "" msgid "WARNING: Any files you place in %s will be automatically deleted after being added to calibre. Are you sure?" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:119 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:123 msgid "Here you can control how calibre will read metadata from the files you add to it. calibre can either read metadata from the contents of the file, or from the filename." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:120 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:124 msgid "Read &metadata from file contents rather than file name" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:121 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:125 msgid "Swap the firstname and lastname of the author. This affects only metadata read from file names." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:122 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:126 msgid "&Swap author firstname and lastname" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:123 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:127 msgid "When using the \"&Copy to library\" action to copy books between libraries, preserve the date" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:124 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:128 msgid "" "Automerge: If books with similar titles and authors found, merge the incoming formats automatically into\n" "existing book records. The box to the right controls what happens when an existing record already has\n" @@ -11476,11 +11479,11 @@ msgid "" "Title match ignores leading indefinite articles (\"the\", \"a\", \"an\"), punctuation, case, etc. Author match is exact." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:129 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:133 msgid "&Automerge added books if they already exist in the calibre library:" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:130 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:134 msgid "" "Automerge: If books with similar titles and authors found, merge the incoming formats automatically into\n" "existing book records. This box controls what happens when an existing record already has\n" @@ -11494,23 +11497,23 @@ msgid "" "Author matching is exact." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:140 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:144 msgid "&Tags to apply when adding a book:" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:141 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:145 msgid "A comma-separated list of tags that will be applied to books added to the library" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:142 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:146 msgid "&Configure metadata from file name" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:143 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:147 msgid "The Add &Process" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:144 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:148 msgid "" "If set, this option will causes calibre to check if a file\n" " being auto-added is already in the calibre library.\n" @@ -11518,35 +11521,35 @@ msgid "" " you want to add it anyway." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:148 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:152 msgid "Check for &duplicates when auto-adding files" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:149 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:153 msgid "Specify a folder. Any files you put into this folder will be automatically added to calibre (restart required)." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:150 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:154 msgid "WARNING: Files in the above folder will be deleted after being added to calibre." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:151 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:155 msgid "Ignore files with the following extensions when automatically adding " msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:152 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:156 msgid "Folder to auto-add files from" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:153 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:157 msgid "Browse for folder" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:155 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:159 msgid "Automatically &convert added files to the current output format" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:156 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/adding_ui.py:160 msgid "&Automatic Adding" msgstr "" @@ -12351,7 +12354,7 @@ msgid "Never" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel.py:145 -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:511 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:518 msgid "By first letter" msgstr "" @@ -13003,80 +13006,90 @@ msgstr "" msgid "&Show files in file browser after saving to disk" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:34 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:35 msgid "Grouped search terms are search names that permit a query to automatically search across more than one column. For example, if you create a grouped search term allseries with the value series, #myseries, #myseries2, then the query allseries:adhoc will find 'adhoc' in any of the columns series, #myseries, and #myseries2.

Enter the name of the grouped search term in the drop-down box, enter the list of columns to search in the value box, then push the Save button.

Note: Search terms are forced to lower case; MySearch and mysearch are the same term.

You can have your grouped search term show up as user categories in the Tag Browser. Just add the grouped search term names to the Make user categories from box. You can add multiple terms separated by commas. The new user category will be automatically populated with all the items in the categories included in the grouped search term.

Automatic user categories permit you to see easily all the category items that are in the columns contained in the grouped search term. Using the above allseries example, the automatically-generated user category will contain all the series mentioned in series, #myseries, and #myseries2. This can be useful to check for duplicates, to find which column contains a particular item, or to have hierarchical categories (categories that contain categories)." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:96 -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:106 -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:110 -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:116 -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:128 -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:119 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:75 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/ui.py:419 +msgid "Match all" +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:75 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/ui.py:419 +msgid "Match any" +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:137 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:147 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:151 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:157 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:170 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:174 msgid "Grouped Search Terms" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:97 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:138 msgid "The search term cannot be blank" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:107 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:148 msgid "That name is already used for a column or grouped search term" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:111 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:152 msgid "That name is already used for user category" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:117 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:158 msgid "The value box cannot be empty" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:129 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search.py:171 msgid "The empty grouped search term cannot be deleted" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:110 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:165 msgid "Search as you &type" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:111 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:166 msgid "&Highlight search results instead of restricting the book list to the results" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:112 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:167 msgid "What to search by default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:113 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:168 msgid "When you enter a search term without a prefix, by default calibre will search all metadata for matches. For example, entering, \"asimov\" will search not just authors but title/tags/series/comments/etc. Use these options if you would like to change this behavior." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:114 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:169 msgid "&Limit the searched metadata" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:115 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:170 msgid "&Columns that non-prefixed searches are limited to:" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:116 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:171 msgid "Note that this option affects all searches, including saved searches and restrictions. Therefore, if you use this option, it is best to ensure that you always use prefixes in your saved searches. For example, use \"series:Foundation\" rather than just \"Foundation\" in a saved search" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:117 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:172 msgid "Clear search histories from all over calibre. Including the book list, e-book viewer, fetch news dialog, etc." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:118 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:173 msgid "Clear search &histories" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:120 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:175 msgid "&Names:" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:121 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:176 msgid "" "Contains the names of the currently-defined group search terms.\n" "Create a new name by entering it into the empty box, then\n" @@ -13085,27 +13098,56 @@ msgid "" "a search term by changing the value box then pressing Save." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:126 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:181 msgid "Delete the current search term" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:128 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:183 msgid "" "Save the current search term. You can rename a search term by\n" "changing the name then pressing Save. You can change the value\n" "of a search term by changing the value box then pressing Save." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:132 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:187 msgid "Make &user categories from:" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:133 +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:188 msgid "" "Enter the names of any grouped search terms you wish\n" "to be shown as user categories" msgstr "" +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:190 +msgid "What to search when searching similar books" +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:191 +msgid "" +"

When you search for similar books by right clicking the\n" +" book and selecting \"Similar books...\",\n" +" calibre constructs a search using the column lookup names specified below.\n" +" By changing the lookup name to a grouped search term you can\n" +" search multiple columns at once.

" +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:196 +msgid "Similar authors: " +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:197 +msgid "Similar series: " +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:198 +msgid "Similar tags: " +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/gui2/preferences/search_ui.py:199 +msgid "Similar publishers: " +msgstr "" + #: /home/kovid/work/calibre/src/calibre/gui2/preferences/sending.py:28 #: /home/kovid/work/calibre/src/calibre/gui2/preferences/sending_ui.py:70 msgid "Manual management" @@ -13997,7 +14039,7 @@ msgid "Changing the metadata for that many books can take a while. Are you sure? msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/model.py:836 -#: /home/kovid/work/calibre/src/calibre/library/database2.py:469 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:477 msgid "Searches" msgstr "" @@ -14043,13 +14085,13 @@ msgid "Manage Tags" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/ui.py:57 -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:494 -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:498 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:501 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:505 msgid "Manage User Categories" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/ui.py:59 -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:486 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:493 msgid "Manage Saved Searches" msgstr "" @@ -14166,14 +14208,6 @@ msgstr "" msgid "Match type" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/ui.py:419 -msgid "Match all" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/ui.py:419 -msgid "Match any" -msgstr "" - #: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/ui.py:425 msgid "When selecting multiple entries in the Tag Browser match any or all of them" msgstr "" @@ -14186,110 +14220,105 @@ msgstr "" msgid "All of these category_managers are available by right-clicking on items in the tag browser above" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:367 -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:406 -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:436 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:374 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:413 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:443 #, python-format msgid "Rename %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:373 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:380 #, python-format msgid "Delete %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:377 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:384 #, python-format msgid "Edit sort for %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:380 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:387 #, python-format msgid "Edit link for %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:387 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:394 #, python-format msgid "Add %s to user category" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:400 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:407 #, python-format msgid "Children of %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:410 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:417 #, python-format msgid "Delete search %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:415 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:422 #, python-format msgid "Remove %(item)s from category %(cat)s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:423 -#, python-format -msgid "Search for %s" -msgstr "" - -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:428 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:435 #, python-format msgid "Search for everything but %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:440 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:447 #, python-format msgid "Add sub-category to %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:444 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:451 #, python-format msgid "Delete user category %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:449 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:456 #, python-format msgid "Hide category %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:453 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:460 msgid "Show category" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:463 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:470 #, python-format msgid "Search for books in category %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:469 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:476 #, python-format msgid "Search for books not in category %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:478 -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:483 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:485 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:490 #, python-format msgid "Manage %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:505 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:512 msgid "Show all categories" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:508 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:515 msgid "Change sub-categorization scheme" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:509 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:516 msgid "Disable" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:513 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:520 msgid "Partition" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:528 +#: /home/kovid/work/calibre/src/calibre/gui2/tag_browser/view.py:535 msgid "First letter is usable only when sorting by name" msgstr "" @@ -15067,15 +15096,15 @@ msgstr "" msgid "Drag to resize" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/widgets.py:1030 +#: /home/kovid/work/calibre/src/calibre/gui2/widgets.py:1023 msgid "Show" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/widgets.py:1037 +#: /home/kovid/work/calibre/src/calibre/gui2/widgets.py:1030 msgid "Hide" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/widgets.py:1074 +#: /home/kovid/work/calibre/src/calibre/gui2/widgets.py:1067 msgid "Toggle" msgstr "" @@ -16281,17 +16310,17 @@ msgstr "" msgid "%(tt)sAverage rating is %(rating)3.1f" msgstr "" -#: /home/kovid/work/calibre/src/calibre/library/database2.py:3473 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:3481 #, python-format msgid "

Migrating old database to ebook library in %s

" msgstr "" -#: /home/kovid/work/calibre/src/calibre/library/database2.py:3502 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:3510 #, python-format msgid "Copying %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/library/database2.py:3519 +#: /home/kovid/work/calibre/src/calibre/library/database2.py:3527 msgid "Compacting database" msgstr "" @@ -17900,81 +17929,73 @@ msgid "The number of seconds to wait before sending emails when using a\npublic msgstr "" #: /home/kovid/work/calibre/resources/default_tweaks.py:444 -msgid "Remove the bright yellow lines at the edges of the book list" -msgstr "" - -#: /home/kovid/work/calibre/resources/default_tweaks.py:445 -msgid "Control whether the bright yellow lines at the edges of book list are drawn\nwhen a section of the user interface is hidden. Changes will take effect\nafter a restart of calibre." -msgstr "" - -#: /home/kovid/work/calibre/resources/default_tweaks.py:450 msgid "The maximum width and height for covers saved in the calibre library" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:451 +#: /home/kovid/work/calibre/resources/default_tweaks.py:445 msgid "All covers in the calibre library will be resized, preserving aspect ratio,\nto fit within this size. This is to prevent slowdowns caused by extremely\nlarge covers" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:456 +#: /home/kovid/work/calibre/resources/default_tweaks.py:450 msgid "Where to send downloaded news" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:457 +#: /home/kovid/work/calibre/resources/default_tweaks.py:451 msgid "When automatically sending downloaded news to a connected device, calibre\nwill by default send it to the main memory. By changing this tweak, you can\ncontrol where it is sent. Valid values are \"main\", \"carda\", \"cardb\". Note\nthat if there isn't enough free space available on the location you choose,\nthe files will be sent to the location with the most free space." msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:464 +#: /home/kovid/work/calibre/resources/default_tweaks.py:458 msgid "What interfaces should the content server listen on" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:465 +#: /home/kovid/work/calibre/resources/default_tweaks.py:459 msgid "By default, the calibre content server listens on '0.0.0.0' which means that it\naccepts IPv4 connections on all interfaces. You can change this to, for\nexample, '127.0.0.1' to only listen for connections from the local machine, or\nto '::' to listen to all incoming IPv6 and IPv4 connections (this may not\nwork on all operating systems)" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:472 +#: /home/kovid/work/calibre/resources/default_tweaks.py:466 msgid "Unified toolbar on OS X" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:473 +#: /home/kovid/work/calibre/resources/default_tweaks.py:467 msgid "If you enable this option and restart calibre, the toolbar will be 'unified'\nwith the titlebar as is normal for OS X applications. However, doing this has\nvarious bugs, for instance the minimum width of the toolbar becomes twice\nwhat it should be and it causes other random bugs on some systems, so turn it\non at your own risk!" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:480 +#: /home/kovid/work/calibre/resources/default_tweaks.py:474 msgid "Save original file when converting from same format to same format" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:481 +#: /home/kovid/work/calibre/resources/default_tweaks.py:475 msgid "When calibre does a conversion from the same format to the same format, for\nexample, from EPUB to EPUB, the original file is saved, so that in case the\nconversion is poor, you can tweak the settings and run it again. By setting\nthis to False you can prevent calibre from saving the original file." msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:487 +#: /home/kovid/work/calibre/resources/default_tweaks.py:481 msgid "Number of recently viewed books to show" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:488 +#: /home/kovid/work/calibre/resources/default_tweaks.py:482 msgid "Right-clicking the View button shows a list of recently viewed books. Control\nhow many should be shown, here." msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:492 +#: /home/kovid/work/calibre/resources/default_tweaks.py:486 msgid "Change the font size of book details in the interface" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:493 +#: /home/kovid/work/calibre/resources/default_tweaks.py:487 msgid "Change the font size at which book details are rendered in the side panel and\ncomments are rendered in the metadata edit dialog. Set it to a positive or\nnegative number to increase or decrease the font size." msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:498 +#: /home/kovid/work/calibre/resources/default_tweaks.py:492 msgid "Compile General Program Mode templates to Python" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:499 +#: /home/kovid/work/calibre/resources/default_tweaks.py:493 msgid "Compiled general program mode templates are significantly faster than\ninterpreted templates. Setting this tweak to True causes calibre to compile\n(in most cases) general program mode templates. Setting it to False causes\ncalibre to use the old behavior -- interpreting the templates. Set the tweak\nto False if some compiled templates produce incorrect values.\nDefault: compile_gpm_templates = True\nNo compile: compile_gpm_templates = False" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:508 +#: /home/kovid/work/calibre/resources/default_tweaks.py:502 msgid "What format to default to when using the Tweak feature" msgstr "" -#: /home/kovid/work/calibre/resources/default_tweaks.py:509 +#: /home/kovid/work/calibre/resources/default_tweaks.py:503 msgid "The Tweak feature of calibre allows direct editing of a book format.\nIf multiple formats are available, calibre will offer you a choice\nof formats, defaulting to your preferred output format if it is available.\nSet this tweak to a specific value of 'EPUB' or 'AZW3' to always default\nto that format rather than your output format preference.\nSet to a value of 'remember' to use whichever format you chose last time you\nused the Tweak feature.\nExamples:\ndefault_tweak_format = None (Use output format)\ndefault_tweak_format = 'EPUB'\ndefault_tweak_format = 'remember'" msgstr "" From 0fa0fca0b5e53303037401d913198f89bd1d6b63 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 13 Jun 2012 10:28:52 +0530 Subject: [PATCH 04/12] AZW3 Output: Close self closing script/style/title/head tags explicitly as they cause problems in webkit based renderers like the Kindle Fire and calibre's viewers. --- src/calibre/ebooks/mobi/writer8/main.py | 10 ++++++++++ src/calibre/ebooks/mobi/writer8/skeleton.py | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/writer8/main.py b/src/calibre/ebooks/mobi/writer8/main.py index 0f45b8e494..5acb04ebb3 100644 --- a/src/calibre/ebooks/mobi/writer8/main.py +++ b/src/calibre/ebooks/mobi/writer8/main.py @@ -53,6 +53,7 @@ class KF8Writer(object): self.log('\tGenerating KF8 markup...') self.dup_data() + self.cleanup_markup() self.replace_resource_links() self.extract_css_into_flows() self.extract_svg_into_flows() @@ -89,6 +90,15 @@ class KF8Writer(object): def data(self, item): return self._data_cache.get(item.href, item.data) + def cleanup_markup(self): + for item in self.oeb.spine: + root = self.data(item) + + # Remove empty script tags as they are pointless + for tag in XPath('//h:script')(root): + if not tag.text and not tag.get('src', False): + tag.getparent().remove(tag) + def replace_resource_links(self): ''' Replace links to resources (raster images/fonts) with pointers to the MOBI record containing the resource. The pointers are of the form: diff --git a/src/calibre/ebooks/mobi/writer8/skeleton.py b/src/calibre/ebooks/mobi/writer8/skeleton.py index 7f79f12726..ae083163d2 100644 --- a/src/calibre/ebooks/mobi/writer8/skeleton.py +++ b/src/calibre/ebooks/mobi/writer8/skeleton.py @@ -33,7 +33,8 @@ aid_able_tags = {'a', 'abbr', 'address', 'article', 'aside', 'audio', 'b', 'video'} _self_closing_pat = re.compile(bytes( - r'<(?P%s)(?=[\s/])(?P[^>]*)/>'%('|'.join(aid_able_tags))), + r'<(?P%s)(?=[\s/])(?P[^>]*)/>'%('|'.join(aid_able_tags|{'script', + 'style', 'title', 'head'}))), re.IGNORECASE) def close_self_closing_tags(raw): @@ -118,6 +119,7 @@ class Skeleton(object): def render(self, root): raw = tostring(root, xml_declaration=True) raw = raw.replace(b' Date: Wed, 13 Jun 2012 13:38:14 +0530 Subject: [PATCH 05/12] Make the new calibre style default on windows and OS X --- src/calibre/gui2/__init__.py | 4 ++-- src/calibre/gui2/preferences/look_feel.py | 2 +- src/calibre/gui2/preferences/look_feel.ui | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index d9413c4730..6040649b50 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -106,7 +106,7 @@ gprefs.defaults['auto_add_path'] = None gprefs.defaults['auto_add_check_for_duplicates'] = False gprefs.defaults['blocked_auto_formats'] = [] gprefs.defaults['auto_add_auto_convert'] = True -gprefs.defaults['widget_style'] = 'system' +gprefs.defaults['ui_style'] = 'calibre' if iswindows or isosx else 'system' # }}} NONE = QVariant() #: Null value to return from the data function of item models @@ -782,7 +782,7 @@ class Application(QApplication): font.setStretch(s) QApplication.setFont(font) - if force_calibre_style or gprefs['widget_style'] != 'system': + if force_calibre_style or gprefs['ui_style'] != 'system': self.load_calibre_style() else: st = self.style() diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index 2c675d1ee2..7fcdebe32f 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -101,7 +101,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): r('gui_layout', config, restart_required=True, choices= [(_('Wide'), 'wide'), (_('Narrow'), 'narrow')]) - r('widget_style', gprefs, restart_required=True, choices= + r('ui_style', gprefs, restart_required=True, choices= [(_('System default'), 'system'), (_('Calibre style'), 'calibre')]) diff --git a/src/calibre/gui2/preferences/look_feel.ui b/src/calibre/gui2/preferences/look_feel.ui index 0162d429fe..6bcb964e2a 100644 --- a/src/calibre/gui2/preferences/look_feel.ui +++ b/src/calibre/gui2/preferences/look_feel.ui @@ -187,12 +187,12 @@ User interface &style (needs restart): - opt_widget_style + opt_ui_style - + From 34837c3cb591beb2e6e87ed8a1b6fd5b3fad2dbc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 13 Jun 2012 19:18:28 +0530 Subject: [PATCH 06/12] ... --- manual/creating_plugins.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual/creating_plugins.rst b/manual/creating_plugins.rst index d38abfd341..5963f4a890 100644 --- a/manual/creating_plugins.rst +++ b/manual/creating_plugins.rst @@ -172,7 +172,7 @@ You can see the ``prefs`` object being used in main.py: :pyobject: DemoDialog.config -The different types of plugins +The plugin API -------------------------------- As you may have noticed above, a plugin in |app| is a class. There are different classes for the different types of plugins in |app|. From 64268046ab2e39ae1dc45ab43d91890d2492793e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 13 Jun 2012 20:28:43 +0530 Subject: [PATCH 07/12] AZW3 Output: Fix TOC at start option not working --- src/calibre/ebooks/mobi/writer8/toc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/writer8/toc.py b/src/calibre/ebooks/mobi/writer8/toc.py index 2c90a06f8c..313c454535 100644 --- a/src/calibre/ebooks/mobi/writer8/toc.py +++ b/src/calibre/ebooks/mobi/writer8/toc.py @@ -73,7 +73,7 @@ class TOCAdder(object): id, href = oeb.manifest.generate('contents', 'contents.xhtml') item = self.generated_item = oeb.manifest.add(id, href, XHTML_MIME, data=root) - if opts.mobi_toc_at_start == 'end': + if self.at_start: oeb.spine.insert(0, item, linear=True) else: oeb.spine.add(item, linear=False) From e2583c7d364841b7d8dd707672e057c62d79eb93 Mon Sep 17 00:00:00 2001 From: GRiker Date: Wed, 13 Jun 2012 16:51:34 -0600 Subject: [PATCH 08/12] Added code to detect iTunes sandboxing --- src/calibre/devices/apple/driver.py | 32 +++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/apple/driver.py b/src/calibre/devices/apple/driver.py index 09d0466f40..cf8eee706c 100644 --- a/src/calibre/devices/apple/driver.py +++ b/src/calibre/devices/apple/driver.py @@ -101,8 +101,6 @@ class AppleOpenFeedback(OpenFeedback): return Dialog(parent, self) - - class DriverBase(DeviceConfig, DevicePlugin): # Needed for config_widget to work FORMATS = ['epub', 'pdf'] @@ -212,6 +210,15 @@ class ITUNES(DriverBase): "Unsupported direct connect mode. " "See http://www.mobileread.com/forums/showthread.php?t=118559 " "for instructions on using 'Connect to iTunes'") + ITUNES_SANDBOX_LOCKOUT_MESSAGE = _( + '

Unable to communicate with iTunes.

' + "

As of iTunes version 10.6.3, application 'sandboxing' " + 'was implemented by Apple, disabling inter-application communications ' + 'between iTunes and third-party applications.

' + '

Refer to the forum post ' + 'Apple implements sandboxing for iTunes 10.6.3 ' + 'for more information.

' + '

') # Product IDs: # 0x1291 iPod Touch @@ -840,6 +847,9 @@ class ITUNES(DriverBase): we need to talk to iTunes to discover if there's a connected iPod ''' + if self.iTunes is None: + raise OpenFeedback(self.ITUNES_SANDBOX_LOCKOUT_MESSAGE) + if DEBUG: logger().info("ITUNES.open(connected_device: %s)" % repr(connected_device)) @@ -2372,6 +2382,21 @@ class ITUNES(DriverBase): self.iTunes = appscript.app('iTunes') self.initial_status = 'already running' + ''' + Test OSA. If we can't get the app name, we can't talk to iTunes. + As of iTunes 10.6.3 (June 2012), sandboxing was implemented disabling OSA + interapp communications. + If unable to communicate with iTunes, set self.iTunes to None, then + report to user in open() + ''' + try: + foo = self.iTunes.name() + except: + self.iTunes = None + if DEBUG: + logger().info(" unable to communicate with iTunes, raising dialog to user") + return + ''' # Read the current storage path for iTunes media cmd = "defaults read com.apple.itunes NSNavLastRootDirectory" @@ -3319,6 +3344,9 @@ class ITUNES_ASYNC(ITUNES): Note that most of the initialization is necessarily performed in can_handle(), as we need to talk to iTunes to discover if there's a connected iPod ''' + if self.iTunes is None: + raise OpenFeedback(self.ITUNES_SANDBOX_LOCKOUT_MESSAGE) + if DEBUG: logger().info("ITUNES_ASYNC.open(connected_device: %s)" % repr(connected_device)) From 462945fd395e678795b12edce217916cdb0831b9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Jun 2012 09:07:21 +0530 Subject: [PATCH 09/12] Fix #1012903 (Updated recipe for The Christian Science Monitor) --- recipes/chr_mon.recipe | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/recipes/chr_mon.recipe b/recipes/chr_mon.recipe index f2a11cc067..dd8b3e0b33 100644 --- a/recipes/chr_mon.recipe +++ b/recipes/chr_mon.recipe @@ -4,6 +4,7 @@ __copyright__ = '2012, Darko Miletic ' www.csmonitor.com ''' +import re from calibre.web.feeds.news import BasicNewsRecipe class CSMonitor(BasicNewsRecipe): @@ -40,13 +41,15 @@ class CSMonitor(BasicNewsRecipe): remove_tags = [ dict(name=['meta','link','iframe','object','embed']) - ,dict(attrs={'class':['podStoryRel','bottom-rel','hide']}) + ,dict(attrs={'class':re.compile('(^|| )podStoryRel($|| )', re.DOTALL)}) + ,dict(attrs={'class':['bottom-rel','hide']}) ,dict(attrs={'id':['pgallerycarousel_enlarge','pgallerycarousel_related']}) ] keep_only_tags = [ dict(name='h1', attrs={'class':'head'}) ,dict(name='h2', attrs={'class':'subhead'}) - ,dict(attrs={'class':['sByline','podStoryGal','ui-body-header','sBody']}) + ,dict(attrs={'class':['sByline','thePhoto','ui-body-header']}) + ,dict(attrs={'class':re.compile('(^|| )sBody($|| )', re.DOTALL)}) ] remove_attributes=['xmlns:fb'] @@ -74,10 +77,10 @@ class CSMonitor(BasicNewsRecipe): if nexttag: nurl = 'http://www.csmonitor.com' + nexttag['href'] soup2 = self.index_to_soup(nurl) - texttag = soup2.find(attrs={'class':'sBody'}) + texttag = soup2.find(attrs={'class':re.compile('(^|| )sBody($|| )', re.DOTALL)}) if texttag: - appendtag = soup.find(attrs={'class':'sBody'}) - for citem in texttag.findAll(attrs={'class':['podStoryRel','bottom-rel','hide']}): + appendtag = soup.find(attrs={'class':re.compile('(^|| )sBody($|| )', re.DOTALL)}) + for citem in texttag.findAll(attrs={'class':[re.compile('(^|| )podStoryRel($|| )', re.DOTALL),'bottom-rel','hide']}): citem.extract() self.append_page(soup2) texttag.extract() From afe5f095835806b7350cb9ce4e6f1b70427020f9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Jun 2012 10:57:08 +0530 Subject: [PATCH 10/12] ... --- resources/viewer/referencing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/viewer/referencing.js b/resources/viewer/referencing.js index 09a9004c77..eceea9f31d 100644 --- a/resources/viewer/referencing.js +++ b/resources/viewer/referencing.js @@ -15,7 +15,7 @@ function show_reference_panel(ref) { panel = $("#calibre_reference_panel"); } $("> p", panel).text(ref); - panel.css({top:(window.pageYOffset+20)+"px"}); + panel.css({top:(window.pageYOffset+20)+"px", left:(window.pageXOffset+20)+"px"}); panel.fadeIn(500); } From 43edf15118920b75a2b375dc0c66a2bb21707564 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Jun 2012 15:07:23 +0530 Subject: [PATCH 11/12] Add option to restore alternating row colors to the Tag Browser under Preferences->Look & Feel->Tag Browser --- src/calibre/gui2/__init__.py | 1 + src/calibre/gui2/preferences/look_feel.py | 1 + src/calibre/gui2/preferences/look_feel.ui | 49 +++++++++++++---------- src/calibre/gui2/tag_browser/view.py | 20 +++++++-- 4 files changed, 46 insertions(+), 25 deletions(-) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 6040649b50..63abde25dd 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -107,6 +107,7 @@ gprefs.defaults['auto_add_check_for_duplicates'] = False gprefs.defaults['blocked_auto_formats'] = [] gprefs.defaults['auto_add_auto_convert'] = True gprefs.defaults['ui_style'] = 'calibre' if iswindows or isosx else 'system' +gprefs.defaults['tag_browser_old_look'] = False # }}} NONE = QVariant() #: Null value to return from the data function of item models diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index 7fcdebe32f..84b75dd663 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -104,6 +104,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): r('ui_style', gprefs, restart_required=True, choices= [(_('System default'), 'system'), (_('Calibre style'), 'calibre')]) + r('tag_browser_old_look', gprefs, restart_required=True) r('cover_flow_queue_length', config, restart_required=True) diff --git a/src/calibre/gui2/preferences/look_feel.ui b/src/calibre/gui2/preferences/look_feel.ui index 6bcb964e2a..9621b20871 100644 --- a/src/calibre/gui2/preferences/look_feel.ui +++ b/src/calibre/gui2/preferences/look_feel.ui @@ -312,6 +312,18 @@ Manage Authors. You can use the values {author} and Tag Browser + + + + A comma-separated list of categories in which items containing +periods are displayed in the tag browser trees. For example, if +this box contains 'tags' then tags of the form 'Mystery.English' +and 'Mystery.Thriller' will be displayed with English and Thriller +both under 'Mystery'. If 'tags' is not in this box, +then the tags will be displayed each on their own line. + + + @@ -354,6 +366,19 @@ up into subcategories. If the partition method is set to disable, this value is + + + + Qt::Vertical + + + + 690 + 252 + + + + @@ -396,27 +421,9 @@ a few top-level elements. - - - Qt::Vertical - - - - 690 - 252 - - - - - - - - A comma-separated list of categories in which items containing -periods are displayed in the tag browser trees. For example, if -this box contains 'tags' then tags of the form 'Mystery.English' -and 'Mystery.Thriller' will be displayed with English and Thriller -both under 'Mystery'. If 'tags' is not in this box, -then the tags will be displayed each on their own line. + + + Use &alternating row colors in the Tag Browser diff --git a/src/calibre/gui2/tag_browser/view.py b/src/calibre/gui2/tag_browser/view.py index 9331194328..d405294b01 100644 --- a/src/calibre/gui2/tag_browser/view.py +++ b/src/calibre/gui2/tag_browser/view.py @@ -22,6 +22,10 @@ from calibre.utils.icu import sort_key class TagDelegate(QStyledItemDelegate): # {{{ + def __init__(self, *args, **kwargs): + QStyledItemDelegate.__init__(self, *args, **kwargs) + self.old_look = gprefs['tag_browser_old_look'] + def paint(self, painter, option, index): item = index.data(Qt.UserRole).toPyObject() QStyledItemDelegate.paint(self, painter, option, index) @@ -46,7 +50,12 @@ class TagDelegate(QStyledItemDelegate): # {{{ nr = r.adjusted(0, 0, 0, 0) nr.setBottom(r.bottom()-int(r.height()*(rating/5.0))) painter.setClipRect(nr) - painter.fillRect(r, widget.palette().window()) + bg = option.palette.window() + if self.old_look: + bg = (option.palette.alternateBase() if + option.features&option.Alternate else + option.palette.base()) + painter.fillRect(r, bg) style.proxy().drawPrimitive(style.PE_PanelItemViewItem, option, painter, widget) painter.setOpacity(0.3) @@ -108,13 +117,14 @@ class TagsView(QTreeView): # {{{ self._model.user_categories_edited.connect(self.user_categories_edited, type=Qt.QueuedConnection) self._model.drag_drop_finished.connect(self.drag_drop_finished) - self.setStyleSheet(''' + stylish_tb = ''' QTreeView { background-color: palette(window); color: palette(window-text); border: none; } - + ''' + self.setStyleSheet(''' QTreeView::item { border: 1px solid transparent; padding-top:0.9ex; @@ -126,7 +136,9 @@ class TagsView(QTreeView): # {{{ border: 1px solid #bfcde4; border-radius: 6px; } - ''') + ''' + ('' if gprefs['tag_browser_old_look'] else stylish_tb)) + if gprefs['tag_browser_old_look']: + self.setAlternatingRowColors(True) @property def hidden_categories(self): From afb9d18597bebc00be8645bc1c2a2d1edfc8deb1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Jun 2012 18:26:54 +0530 Subject: [PATCH 12/12] Get Books: Add the SONY Reader store --- src/calibre/customize/builtins.py | 12 ++- src/calibre/gui2/store/search/search.py | 11 +++ src/calibre/gui2/store/stores/sony_plugin.py | 88 ++++++++++++++++++++ 3 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 src/calibre/gui2/store/stores/sony_plugin.py diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index 2d6b84634b..cced3b194f 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -1177,6 +1177,16 @@ class StoreAmazonKindleStore(StoreBase): formats = ['KINDLE'] affiliate = True +class StoreSonyStore(StoreBase): + name = 'SONY Reader Store' + description = u'SONY Reader books.' + author = 'Kovid Goyal' + actual_plugin = 'calibre.gui2.store.stores.sony_plugin:SonyStore' + + headquarters = 'US' + formats = ['SONY'] + affiliate = False + class StoreAmazonDEKindleStore(StoreBase): name = 'Amazon DE Kindle' author = 'Charles Haley' @@ -1623,7 +1633,7 @@ plugins += [ StoreAmazonITKindleStore, StoreAmazonUKKindleStore, StoreBaenWebScriptionStore, - StoreBNStore, + StoreBNStore, StoreSonyStore, StoreBeamEBooksDEStore, StoreBeWriteStore, StoreBiblioStore, diff --git a/src/calibre/gui2/store/search/search.py b/src/calibre/gui2/store/search/search.py index e4b5c4c2bb..adde77cce1 100644 --- a/src/calibre/gui2/store/search/search.py +++ b/src/calibre/gui2/store/search/search.py @@ -388,3 +388,14 @@ class SearchDialog(QDialog, Ui_Dialog): self.do_search() return QDialog.exec_(self) +if __name__ == '__main__': + from calibre.gui2 import Application + from calibre.gui2.preferences.main import init_gui + import sys + app = Application([]) + app + gui = init_gui() + + s = SearchDialog(gui, query=' '.join(sys.argv[1:])) + s.exec_() + diff --git a/src/calibre/gui2/store/stores/sony_plugin.py b/src/calibre/gui2/store/stores/sony_plugin.py new file mode 100644 index 0000000000..4e12f54ee4 --- /dev/null +++ b/src/calibre/gui2/store/stores/sony_plugin.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai +from __future__ import (unicode_literals, division, absolute_import, + print_function) + +__license__ = 'GPL v3' +__copyright__ = '2012, Kovid Goyal ' +__docformat__ = 'restructuredtext en' + +import urllib +from contextlib import closing + +from lxml import html, etree + +from PyQt4.Qt import QUrl + +from calibre import browser, url_slash_cleaner +from calibre.gui2 import open_url +from calibre.gui2.store import StorePlugin +from calibre.gui2.store.basic_config import BasicStoreConfig +from calibre.gui2.store.search_result import SearchResult +from calibre.gui2.store.web_store_dialog import WebStoreDialog + +class SonyStore(BasicStoreConfig, StorePlugin): + + def open(self, parent=None, detail_item=None, external=False): + if detail_item: + if external or self.config.get('open_external', False): + open_url(QUrl(url_slash_cleaner(detail_item))) + else: + d = WebStoreDialog(self.gui, 'http://ebookstore.sony.com', parent, detail_item) + d.setWindowTitle(self.name) + d.set_tags(self.config.get('tags', '')) + d.exec_() + + def search(self, query, max_results=10, timeout=60): + url = 'http://ebookstore.sony.com/search?keyword=%s'%urllib.quote_plus( + query) + + br = browser() + + counter = max_results + with closing(br.open(url, timeout=timeout)) as f: + doc = html.fromstring(f.read()) + for item in doc.xpath('//div[contains(@class, "searchResult")]/' + 'descendant::li[contains(@class, "hreview")]'): + if counter <= 0: + break + + curr = ''.join(item.xpath('descendant::div[@class="pricing"]/descendant::*[@class="currency"]/@title')).strip() + if not curr: + curr = 'USD' + amt = ''.join(item.xpath('descendant::div[@class="pricing"]/descendant::*[@class="amount"]/text()')).strip() + if not amt: + amt = '0' + s = SearchResult() + s.price = curr+' '+amt + title = item.xpath('descendant::h3[@class="item"]') + if not title: continue + title = etree.tostring(title[0], method='text', + encoding=unicode) + if not title: continue + s.title = title.strip() + s.author = ''.join(item.xpath( + 'descendant::li[contains(@class, "author")]/' + 'a[@class="fn"]/text()')).strip() + if not s.author: continue + detail_url = ''.join(item.xpath('descendant::h3[@class="item"]' + '/descendant::a[@class="fn" and @href]/@href')) + if not detail_url: continue + s.detail_item = detail_url + + counter -= 1 + + cover_url = ''.join(item.xpath( + 'descendant::li[@class="coverart"]/' + 'descendant::img[@src]/@src')) + if cover_url: + if cover_url.startswith('//'): + cover_url = 'http:' + cover_url + elif cover_url.startswith('/'): + cover_url = 'http://ebookstore.sony.com'+cover_url + s.cover_url = url_slash_cleaner(cover_url) + + s.drm = SearchResult.DRM_UNKNOWN + s.formats = 'Sony' + + yield s