From 29d842db3ed632afc4402a9537d444e68b27d1d5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Feb 2009 09:28:47 -0800 Subject: [PATCH 01/22] IGN:Fix #1901 (Recipe update for EPUB generation) --- src/calibre/trac/plugins/templates/linux.html | 5 ++++- src/calibre/web/feeds/recipes/recipe_la_segunda.py | 13 ++++++------- upload.py | 8 +++++++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/calibre/trac/plugins/templates/linux.html b/src/calibre/trac/plugins/templates/linux.html index 5f0f287737..066f3c9b6d 100644 --- a/src/calibre/trac/plugins/templates/linux.html +++ b/src/calibre/trac/plugins/templates/linux.html @@ -114,10 +114,13 @@ sudo python -c "import urllib2; exec urllib2.urlopen('http://calibre.kovidgoyal. wget -O- http://calibre.kovidgoyal.net/downloads/${app}-${version}.tar.gz | tar xvz cd calibre* python setup.py build && sudo python setup.py install +sudo calibre_postinstall Note that if your distribution does not have a correctly compiled libunrar.so, ${app} will not - support rar files. + support rar files. The calibre_postinstall step + is required for device detection and integration + with your desktop environment.

diff --git a/src/calibre/web/feeds/recipes/recipe_la_segunda.py b/src/calibre/web/feeds/recipes/recipe_la_segunda.py index d049d9c92b..5852e6ba9a 100644 --- a/src/calibre/web/feeds/recipes/recipe_la_segunda.py +++ b/src/calibre/web/feeds/recipes/recipe_la_segunda.py @@ -6,8 +6,8 @@ __copyright__ = '2009, Darko Miletic ' lasegunda.com ''' -from calibre.web.feeds.news import BasicNewsRecipe - +from calibre.web.feeds.news import BasicNewsRecipe + class LaSegunda(BasicNewsRecipe): title = 'La Segunda' __author__ = 'Darko Miletic' @@ -21,14 +21,16 @@ class LaSegunda(BasicNewsRecipe): encoding = 'cp1252' cover_url = 'http://www.lasegunda.com/imagenes/logotipo_lasegunda_Oli.gif' remove_javascript = True + language = _('Spanish') html2lrf_options = [ - '--comment', description + '--comment', description , '--category', category , '--publisher', publisher + , '--ignore-tables' ] - html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_tables=True\noverride_css=" p {text-indent: 0em; margin-top: 0em; margin-bottom: 0.5em} "' keep_only_tags = [dict(name='table')] @@ -52,10 +54,7 @@ class LaSegunda(BasicNewsRecipe): def preprocess_html(self, soup): mtag = '' soup.head.insert(0,mtag) - for item in soup.findAll(name='table', width=True): - del item['width'] for item in soup.findAll(style=True): del item['style'] return soup - language = _('Spanish') \ No newline at end of file diff --git a/upload.py b/upload.py index 5bd473e08d..2aeb1461ee 100644 --- a/upload.py +++ b/upload.py @@ -284,7 +284,13 @@ class gui(OptionlessCommand): manifest = '\n\n%s\n\n'%'\n'.join(files) with open('images.qrc', 'wb') as f: f.write(manifest) - check_call(['pyrcc4', '-o', images, 'images.qrc']) + try: + check_call(['pyrcc4', '-o', images, 'images.qrc']) + except: + import traceback + traceback.print_exc() + raise Exception('You do not have pyrcc4 in your PATH. ' + 'Install the PyQt4 development tools.') else: print 'Images are up to date' finally: From 8e248482aa5c7a0777cda9b5117fb305e836f04c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Feb 2009 10:17:20 -0800 Subject: [PATCH 02/22] EPUB Output: Fix regression in handling of comments that would occassionally cause content in the comments to leak into the text --- src/calibre/ebooks/epub/from_html.py | 5 ++--- src/calibre/ebooks/html.py | 14 ++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/calibre/ebooks/epub/from_html.py b/src/calibre/ebooks/epub/from_html.py index afd0af73d7..ffe402538f 100644 --- a/src/calibre/ebooks/epub/from_html.py +++ b/src/calibre/ebooks/epub/from_html.py @@ -205,9 +205,8 @@ class HTMLProcessor(Processor, Rationalizer): def save(self): for meta in list(self.root.xpath('//meta')): meta.getparent().remove(meta) - #for img in self.root.xpath('//img[@src]'): - # self.convert_image(img) - Processor.save(self) + # Strip all comments since Adobe DE is petrified of them + Processor.save(self, strip_comments=True) def remove_first_image(self): images = self.root.xpath('//img') diff --git a/src/calibre/ebooks/html.py b/src/calibre/ebooks/html.py index 340f5636eb..1c15973d3b 100644 --- a/src/calibre/ebooks/html.py +++ b/src/calibre/ebooks/html.py @@ -332,8 +332,6 @@ class PreProcessor(object): (re.compile(r'&(\S+?);'), convert_entities), # Remove the ]*>'), lambda match: ''), - # Strip all comments since Adobe DE is petrified of them - (re.compile(r'', re.DOTALL).sub('', ans) with open(self.save_path(), 'wb') as f: f.write(ans) return f.name @@ -594,7 +596,7 @@ class Processor(Parser): mark = etree.Element('hr', style=page_break_before) elem.addprevious(mark) - def save(self): + def save(self, strip_comments=False): style_path = os.path.splitext(os.path.basename(self.save_path()))[0] for i, sheet in enumerate([self.stylesheet, self.font_css, self.override_css]): if sheet is not None: @@ -608,7 +610,7 @@ class Processor(Parser): if isinstance(raw, unicode): raw = raw.encode('utf-8') open(path, 'wb').write(raw) - return Parser.save(self) + return Parser.save(self, strip_comments=strip_comments) def populate_toc(self, toc): ''' From af8f3b56ce86a33ee8e0ec8f8e909ce2c0bddf55 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Feb 2009 10:58:45 -0800 Subject: [PATCH 03/22] News download: Handle HTML entities in article titles --- src/calibre/web/feeds/__init__.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/calibre/web/feeds/__init__.py b/src/calibre/web/feeds/__init__.py index 3bc1110db9..82e3f40c10 100644 --- a/src/calibre/web/feeds/__init__.py +++ b/src/calibre/web/feeds/__init__.py @@ -5,10 +5,11 @@ __copyright__ = '2008, Kovid Goyal ' ''' Contains the logic for parsing feeds. ''' -import time, logging, traceback, copy +import time, logging, traceback, copy, re from datetime import datetime from calibre.web.feeds.feedparser import parse +from calibre import entity_to_unicode from lxml import html class Article(object): @@ -19,6 +20,12 @@ class Article(object): self.downloaded = False self.id = id self.title = title.strip() if title else title + try: + self.title = re.sub(r'&(\S+);', + entity_to_unicode, self.title) + print 11111, repr(self.title) + except: + pass self.url = url self.summary = summary if summary and not isinstance(summary, unicode): @@ -37,6 +44,7 @@ class Article(object): self.date = published self.utctime = datetime(*self.date[:6]) self.localtime = self.utctime + self.time_offset + def __repr__(self): return \ @@ -91,7 +99,8 @@ class Feed(object): if len(self.articles) >= max_articles_per_feed: break self.parse_article(item) - + + def populate_from_preparsed_feed(self, title, articles, oldest_article=7, max_articles_per_feed=100): self.title = title if title else _('Unknown feed') From d221e7e448f245867479671f316520597cf86115 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Feb 2009 11:42:28 -0800 Subject: [PATCH 04/22] New recipe for The Chicago Tribune by Kovid Goyal --- src/calibre/web/feeds/__init__.py | 1 - src/calibre/web/feeds/recipes/__init__.py | 2 +- .../feeds/recipes/recipe_chicago_tribune.py | 82 +++++++++++++++++++ 3 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 src/calibre/web/feeds/recipes/recipe_chicago_tribune.py diff --git a/src/calibre/web/feeds/__init__.py b/src/calibre/web/feeds/__init__.py index 82e3f40c10..3f0ec414a2 100644 --- a/src/calibre/web/feeds/__init__.py +++ b/src/calibre/web/feeds/__init__.py @@ -23,7 +23,6 @@ class Article(object): try: self.title = re.sub(r'&(\S+);', entity_to_unicode, self.title) - print 11111, repr(self.title) except: pass self.url = url diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 19c4f2827a..92fbbda555 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -30,7 +30,7 @@ recipe_modules = ['recipe_' + r for r in ( 'honoluluadvertiser', 'starbulletin', 'exiled', 'indy_star', 'dna', 'pobjeda', 'chicago_breaking_news', 'glasgow_herald', 'linuxdevices', 'hindu', 'cincinnati_enquirer', 'physics_world', 'pressonline', - 'la_republica', 'physics_today', + 'la_republica', 'physics_today', 'chicago_tribune', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_chicago_tribune.py b/src/calibre/web/feeds/recipes/recipe_chicago_tribune.py new file mode 100644 index 0000000000..a4754dd751 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_chicago_tribune.py @@ -0,0 +1,82 @@ +from __future__ import with_statement +__license__ = 'GPL 3' +__copyright__ = '2009, Kovid Goyal ' +__docformat__ = 'restructuredtext en' + +import re +from urlparse import urlparse, urlunparse +from calibre.web.feeds.news import BasicNewsRecipe +from calibre.ptempfile import PersistentTemporaryFile +from threading import RLock + +class ChicagoTribune(BasicNewsRecipe): + + title = 'Chicago Tribune' + __author__ = 'Kovid Goyal' + description = 'Politics, local and business news from Chicago' + language = _('English') + use_embedded_content = False + articles_are_obfuscated = True + remove_tags_before = dict(name='h1') + obfuctation_lock = RLock() + + feeds = [ + ('Latest news', 'http://feeds.chicagotribune.com/chicagotribune/news/'), + ('Local news', 'http://feeds.chicagotribune.com/chicagotribune/news/local/'), + ('Nation/world', 'http://feeds.chicagotribune.com/chicagotribune/news/nationworld/'), + ('Hot topics', 'http://feeds.chicagotribune.com/chicagotribune/hottopics/'), + ('Most E-mailed stories', 'http://feeds.chicagotribune.com/chicagotribune/email/'), + ('Opinion', 'http://feeds.chicagotribune.com/chicagotribune/opinion/'), + ('Off Topic', 'http://feeds.chicagotribune.com/chicagotribune/offtopic/'), + ('Politics', 'http://feeds.chicagotribune.com/chicagotribune/politics/'), + ('Special Reports', 'http://feeds.chicagotribune.com/chicagotribune/special/'), + ('Religion News', 'http://feeds.chicagotribune.com/chicagotribune/religion/'), + ('Business news', 'http://feeds.chicagotribune.com/chicagotribune/business/'), + ('Jobs and Careers', 'http://feeds.chicagotribune.com/chicagotribune/career/'), + ('Local scene', 'http://feeds.chicagotribune.com/chicagohomes/localscene/'), + ('Phil Rosenthal', 'http://feeds.chicagotribune.com/chicagotribune/rosenthal/'), + ('Tech Buzz', 'http://feeds.chicagotribune.com/chicagotribune/techbuzz/'), + ('Your Money', 'http://feeds.chicagotribune.com/chicagotribune/yourmoney/'), + ('Jon Hilkevitch - Getting around', 'http://feeds.chicagotribune.com/chicagotribune/gettingaround/'), + ('Jon Yates - What\'s your problem?', 'http://feeds.chicagotribune.com/chicagotribune/problem/'), + ('Garisson Keillor', 'http://feeds.chicagotribune.com/chicagotribune/keillor/'), + ('Marks Jarvis - On Money', 'http://feeds.chicagotribune.com/chicagotribune/marksjarvisonmoney/'), + ('Sports', 'http://feeds.chicagotribune.com/chicagotribune/sports/'), + ('Arts and Architecture', 'http://feeds.chicagotribune.com/chicagotribune/arts/'), + ('Books', 'http://feeds.chicagotribune.com/chicagotribune/books/'), + ('Magazine', 'http://feeds.chicagotribune.com/chicagotribune/magazine/'), + ('Movies', 'http://feeds.chicagotribune.com/chicagotribune/movies/'), + ('Music', 'http://feeds.chicagotribune.com/chicagotribune/movies/'), + ('TV', 'http://feeds.chicagotribune.com/chicagotribune/tv/'), + ('Hypertext', 'http://feeds.chicagotribune.com/chicagotribune/hypertext/'), + ('iPhone Blog', 'http://feeds.feedburner.com/redeye/iphoneblog'), + ('Julie\'s Health Club', 'http://feeds.chicagotribune.com/chicagotribune_julieshealthclub/'), + ] + + temp_files = [] + + def get_article_url(self, article): + return article.get('feedburner_origlink', article.get('guid', article.get('link'))) + + def get_obfuscated_article(self, url, logger): + with self.obfuctation_lock: + soup = self.index_to_soup(url) + img = soup.find('img', alt='Print') + if img is not None: + a = img.parent.find('a', href=True) + purl = urlparse(url) + xurl = urlunparse(purl[:2] + (a['href'], '', '', '')) + soup = self.index_to_soup(xurl) + for img in soup.findAll('img', src=True): + if img['src'].startswith('/'): + img['src'] = urlunparse(purl[:2]+(img['src'], '', '', '')) + html = unicode(soup) + else: + h1 = soup.find(id='page-title') + body = soup.find(attrs={'class':re.compile('asset-content')}) + html = u'%s'%(unicode(h1)+unicode(body)) + self.temp_files.append(PersistentTemporaryFile('_chicago_tribune.xhtml')) + self.temp_files[-1].write(html.encode('utf-8')) + self.temp_files[-1].close() + return self.temp_files[-1].name + From e6473047fec2fde9a31f1bdb437d4459d0031726 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Feb 2009 11:47:03 -0800 Subject: [PATCH 05/22] FB2 input:Fix regression that prevented metadata from being read from input FB2 file when converting on the command line --- src/calibre/ebooks/lrf/fb2/convert_from.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/lrf/fb2/convert_from.py b/src/calibre/ebooks/lrf/fb2/convert_from.py index dc4644d292..24562e708c 100644 --- a/src/calibre/ebooks/lrf/fb2/convert_from.py +++ b/src/calibre/ebooks/lrf/fb2/convert_from.py @@ -38,6 +38,7 @@ def extract_embedded_content(doc): open(fname, 'wb').write(data) def to_html(fb2file, tdir): + fb2file = os.path.abspath(fb2file) cwd = os.getcwd() try: os.chdir(tdir) @@ -52,7 +53,7 @@ def to_html(fb2file, tdir): result = transform(doc) open('index.html', 'wb').write(transform.tostring(result)) try: - mi = get_metadata(open(fb2file, 'rb')) + mi = get_metadata(open(fb2file, 'rb'), 'fb2') except: mi = MetaInformation(None, None) if not mi.title: From 70b99872c670aeb11f2cfa11ed8ff82a79f129c2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Feb 2009 13:07:32 -0800 Subject: [PATCH 06/22] EPUB Output:Be less aggressive when stripping invalid HTML constructs inserted by MS Word. Fixes regression in the Time recipe. --- src/calibre/ebooks/html.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/html.py b/src/calibre/ebooks/html.py index 1c15973d3b..1f1e6b94b1 100644 --- a/src/calibre/ebooks/html.py +++ b/src/calibre/ebooks/html.py @@ -331,7 +331,8 @@ class PreProcessor(object): # Convert all entities, since lxml doesn't handle them well (re.compile(r'&(\S+?);'), convert_entities), # Remove the ]*>'), lambda match: ''), + (re.compile(r'', re.IGNORECASE), + lambda match: ''), ] # Fix pdftohtml markup From c5bae5d403a4e9518372d5889212ca2813ace9e5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Feb 2009 14:40:16 -0800 Subject: [PATCH 07/22] Fix #1888 (Bulk Convert Problem) --- src/calibre/ebooks/lrf/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/ebooks/lrf/__init__.py b/src/calibre/ebooks/lrf/__init__.py index 2f9d724ce2..ae74e429ad 100644 --- a/src/calibre/ebooks/lrf/__init__.py +++ b/src/calibre/ebooks/lrf/__init__.py @@ -30,6 +30,7 @@ preferred_source_formats = [ 'XHTML', 'PRC', 'AZW', + 'FB2', 'RTF', 'PDF', 'TXT', From 7475c520ab5fba4b1598e093672e93dee0779463 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Feb 2009 16:19:34 -0800 Subject: [PATCH 08/22] version 0.4.139 --- src/calibre/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/constants.py b/src/calibre/constants.py index a903e67e04..e6f9b771e9 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -2,7 +2,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' __appname__ = 'calibre' -__version__ = '0.4.138' +__version__ = '0.4.139' __author__ = "Kovid Goyal " ''' Various run time constants. From 40c50665c5a7572278f3b00594792e3f63794d4c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Feb 2009 16:32:55 -0800 Subject: [PATCH 09/22] IGN:Tag release From 544346837cfddd44c9c6f0647061864b8bd208d9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 21 Feb 2009 11:17:59 -0800 Subject: [PATCH 10/22] New recipes for E-Novine and Al Jazeera by Darko Miletic --- src/calibre/gui2/images/news/e_novine.png | Bin 0 -> 295 bytes src/calibre/web/feeds/recipes/__init__.py | 3 +- .../web/feeds/recipes/recipe_al_jazeera.py | 50 +++++++++++++++ .../web/feeds/recipes/recipe_e_novine.py | 58 ++++++++++++++++++ upload.py | 4 +- 5 files changed, 112 insertions(+), 3 deletions(-) create mode 100644 src/calibre/gui2/images/news/e_novine.png create mode 100644 src/calibre/web/feeds/recipes/recipe_al_jazeera.py create mode 100644 src/calibre/web/feeds/recipes/recipe_e_novine.py diff --git a/src/calibre/gui2/images/news/e_novine.png b/src/calibre/gui2/images/news/e_novine.png new file mode 100644 index 0000000000000000000000000000000000000000..285e1e6a4dea0e28776141fd3c836b2ae5b3b1d6 GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*VRoB&T3#}JFt$tev?W#88Q=TT{xZ+}`sQbIyv zhR4Mg-VG0oB*h)dHMtGDK1lj)6#pRg;d8pAvZ8*Vy+9`?_phA|6aKdsO9(tJmuS$I z*>H!0p~qC_?}}I6AP1|KxJHyD7o{ear0S*s2?iqr14~^4BV8lI5JO8V0~0Gl18oBX wD+7bSi3>oE0c*(3PsvQH#L!@1Ze?U)Wnu!+V13Mk6R3f~)78&qol`;+04`uupa1{> literal 0 HcmV?d00001 diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 92fbbda555..eed5670cac 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -30,7 +30,8 @@ recipe_modules = ['recipe_' + r for r in ( 'honoluluadvertiser', 'starbulletin', 'exiled', 'indy_star', 'dna', 'pobjeda', 'chicago_breaking_news', 'glasgow_herald', 'linuxdevices', 'hindu', 'cincinnati_enquirer', 'physics_world', 'pressonline', - 'la_republica', 'physics_today', 'chicago_tribune', + 'la_republica', 'physics_today', 'chicago_tribune', 'e_novine', + 'al_jazeera', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_al_jazeera.py b/src/calibre/web/feeds/recipes/recipe_al_jazeera.py new file mode 100644 index 0000000000..9923f00392 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_al_jazeera.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +aljazeera.net +''' +from calibre.web.feeds.news import BasicNewsRecipe + +class AlJazeera(BasicNewsRecipe): + title = 'Al Jazeera in English' + __author__ = 'Darko Miletic' + description = 'News from Middle East' + publisher = 'Al Jazeera' + category = 'news, politics, middle east' + simultaneous_downloads = 1 + delay = 4 + oldest_article = 1 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'iso-8859-1' + remove_javascript = True + use_embedded_content = False + + html2lrf_options = [ + '--comment', description + , '--category', category + , '--publisher', publisher + , '--ignore-tables' + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_table=True' + + keep_only_tags = [dict(name='div', attrs={'id':'ctl00_divContent'})] + + remove_tags = [ + dict(name=['object','link']) + ,dict(name='td', attrs={'class':['MostActiveDescHeader','MostActiveDescBody']}) + ] + + feeds = [(u'AL JAZEERA ENGLISH (AJE)', u'http://english.aljazeera.net/Services/Rss/?PostingId=2007731105943979989' )] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + for item in soup.findAll(face=True): + del item['face'] + return soup + diff --git a/src/calibre/web/feeds/recipes/recipe_e_novine.py b/src/calibre/web/feeds/recipes/recipe_e_novine.py new file mode 100644 index 0000000000..83654fe4c8 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_e_novine.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +e-novine.com +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class E_novine(BasicNewsRecipe): + title = 'E-Novine' + __author__ = 'Darko Miletic' + description = 'News from Serbia' + publisher = 'E-novine' + category = 'news, politics, Balcans' + oldest_article = 1 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'cp1250' + cover_url = 'http://www.e-novine.com/slike/slike_3/r1/g2008/m03/y3165525326702598.jpg' + remove_javascript = True + use_embedded_content = False + language = _('Serbian') + extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{text-align: justify; font-family: serif1, serif} .article_description{font-family: sans1, sans-serif}' + + html2lrf_options = [ + '--comment', description + , '--category', category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0em; margin-top: 0em; margin-bottom: 0.5em} img {margin-top: 0em; margin-bottom: 0.4em}"' + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + keep_only_tags = [dict(name='div', attrs={'id':['css_47_0_2844H']})] + + remove_tags = [dict(name=['object','link','embed','iframe'])] + + feeds = [(u'Sve vesti', u'http://www.e-novine.com/rss/e-novine.xml' )] + + def preprocess_html(self, soup): + soup.html['xml:lang'] = 'sr-Latn-ME' + soup.html['lang'] = 'sr-Latn-ME' + mtag = '' + soup.head.insert(0,mtag) + for item in soup.findAll(style=True): + del item['style'] + ftag = soup.find('div', attrs={'id':'css_47_0_2844H'}) + if ftag: + it = ftag.div + it.extract() + ftag.div.extract() + ftag.insert(0,it) + return soup diff --git a/upload.py b/upload.py index 2aeb1461ee..cab426b191 100644 --- a/upload.py +++ b/upload.py @@ -676,7 +676,7 @@ class stage3(OptionlessCommand): def run(self): OptionlessCommand.run(self) - self.misc() + self.misc() class stage2(OptionlessCommand): description = 'Stage 2 of the build process' @@ -705,4 +705,4 @@ class upload(OptionlessCommand): ('stage1', None), ('stage2', None), ('stage3', None) - ] \ No newline at end of file + ] From 2eee9da901dac31ca2259984014e61dc54b1c7b2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 21 Feb 2009 11:23:06 -0800 Subject: [PATCH 11/22] IGN:Fix #1906 (Minor fixes in spanish recipes) --- src/calibre/web/feeds/recipes/recipe_infobae.py | 5 +++-- src/calibre/web/feeds/recipes/recipe_pagina12.py | 12 +++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/calibre/web/feeds/recipes/recipe_infobae.py b/src/calibre/web/feeds/recipes/recipe_infobae.py index 13c52ca6b1..b5c867b914 100644 --- a/src/calibre/web/feeds/recipes/recipe_infobae.py +++ b/src/calibre/web/feeds/recipes/recipe_infobae.py @@ -19,7 +19,7 @@ class Infobae(BasicNewsRecipe): no_stylesheets = True use_embedded_content = False language = _('Spanish') - encoding = 'iso-8859-1' + encoding = 'cp1252' cover_url = 'http://www.infobae.com/imgs/header/header.gif' remove_javascript = True @@ -28,9 +28,10 @@ class Infobae(BasicNewsRecipe): , '--category' , category , '--publisher', publisher , '--ignore-tables' + , '--ignore-colors' ] - html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_tables=True' + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_tables=True' remove_tags = [ dict(name=['embed','link','object']) diff --git a/src/calibre/web/feeds/recipes/recipe_pagina12.py b/src/calibre/web/feeds/recipes/recipe_pagina12.py index b821ed0b68..f3ed1110fa 100644 --- a/src/calibre/web/feeds/recipes/recipe_pagina12.py +++ b/src/calibre/web/feeds/recipes/recipe_pagina12.py @@ -8,10 +8,8 @@ pagina12.com.ar from calibre import strftime -from calibre.web.feeds.news import BasicNewsRecipe - class Pagina12(BasicNewsRecipe): - title = u'Pagina/12' + title = 'Pagina/12' __author__ = 'Darko Miletic' description = 'Noticias de Argentina y el resto del mundo' publisher = 'La Pagina S.A.' @@ -20,12 +18,14 @@ class Pagina12(BasicNewsRecipe): max_articles_per_feed = 100 no_stylesheets = True encoding = 'cp1252' - cover_url = strftime('http://www.pagina12.com.ar/fotos/%Y%m%d/diario/TAPAN.jpg') + cover_url = strftime('http://www.pagina12.com.ar/fotos/%Y%m%d/diario/tapagn.jpg') remove_javascript = True use_embedded_content = False + language = _('Spanish') + html2lrf_options = [ - '--comment', description + '--comment', description , '--category', category , '--publisher', publisher ] @@ -50,5 +50,3 @@ class Pagina12(BasicNewsRecipe): for item in soup.findAll(style=True): del item['style'] return soup - - language = _('Spanish') \ No newline at end of file From 0467af0c29d5571da100b92f682de4e7dfa82476 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 21 Feb 2009 11:38:24 -0800 Subject: [PATCH 12/22] Cybook Gen3:Fix thumbnail generation. --- src/calibre/devices/cybookg3/driver.py | 1 + src/calibre/devices/cybookg3/t2b.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/cybookg3/driver.py b/src/calibre/devices/cybookg3/driver.py index f092473675..eef32594eb 100644 --- a/src/calibre/devices/cybookg3/driver.py +++ b/src/calibre/devices/cybookg3/driver.py @@ -33,6 +33,7 @@ class CYBOOKG3(USBMS): EBOOK_DIR_MAIN = "eBooks" EBOOK_DIR_CARD = "eBooks" + THUMBNAIL_HEIGHT = 144 SUPPORTS_SUB_DIRS = True def upload_books(self, files, names, on_card=False, end_session=True, diff --git a/src/calibre/devices/cybookg3/t2b.py b/src/calibre/devices/cybookg3/t2b.py index 5bf512f22d..7aaeeb63d7 100644 --- a/src/calibre/devices/cybookg3/t2b.py +++ b/src/calibre/devices/cybookg3/t2b.py @@ -30,7 +30,7 @@ def write_t2b(t2bfile, coverdata=None): if coverdata != None: coverdata = StringIO.StringIO(coverdata) cover = Image.open(coverdata).convert("L") - cover.thumbnail((96, 144)) + cover.thumbnail((96, 144), Image.ANTIALIAS) t2bcover = Image.new('L', (96, 144), 'white') x, y = cover.size From cfcccb044340f850a45dfa76e7a099d9c78bf2a0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 21 Feb 2009 13:12:52 -0800 Subject: [PATCH 13/22] IGN:... --- src/calibre/web/feeds/recipes/recipe_pagina12.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/web/feeds/recipes/recipe_pagina12.py b/src/calibre/web/feeds/recipes/recipe_pagina12.py index f3ed1110fa..039e8a8e15 100644 --- a/src/calibre/web/feeds/recipes/recipe_pagina12.py +++ b/src/calibre/web/feeds/recipes/recipe_pagina12.py @@ -7,6 +7,7 @@ pagina12.com.ar ''' from calibre import strftime +from calibre.web.feeds.news import BasicNewsRecipe class Pagina12(BasicNewsRecipe): title = 'Pagina/12' From 6c8d6a4edb0c2b90537db744caf37f51c8badc6f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 21 Feb 2009 18:56:01 -0800 Subject: [PATCH 14/22] New recipe for Windows SuperSite by Hypernova --- src/calibre/customize/builtins.py | 4 +-- src/calibre/web/feeds/recipes/__init__.py | 2 +- .../web/feeds/recipes/recipe_winsupersite.py | 28 +++++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 src/calibre/web/feeds/recipes/recipe_winsupersite.py diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index a40878480f..14d3c79062 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -233,7 +233,7 @@ class RTFMetadataWriter(MetadataWriterPlugin): class MOBIMetadataWriter(MetadataWriterPlugin): name = 'Set MOBI metadata' - file_types = set(['mobi', 'prc']) + file_types = set(['mobi', 'prc', 'azw']) description = _('Set metadata in %s files')%'MOBI' author = 'Marshall T. Vandegrift' @@ -246,4 +246,4 @@ plugins = [HTML2ZIP] plugins += [x for x in list(locals().values()) if isinstance(x, type) and \ x.__name__.endswith('MetadataReader')] plugins += [x for x in list(locals().values()) if isinstance(x, type) and \ - x.__name__.endswith('MetadataWriter')] \ No newline at end of file + x.__name__.endswith('MetadataWriter')] diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index eed5670cac..579291a83b 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -31,7 +31,7 @@ recipe_modules = ['recipe_' + r for r in ( 'pobjeda', 'chicago_breaking_news', 'glasgow_herald', 'linuxdevices', 'hindu', 'cincinnati_enquirer', 'physics_world', 'pressonline', 'la_republica', 'physics_today', 'chicago_tribune', 'e_novine', - 'al_jazeera', + 'al_jazeera', 'winsupersite', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_winsupersite.py b/src/calibre/web/feeds/recipes/recipe_winsupersite.py new file mode 100644 index 0000000000..fc6bc54da2 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_winsupersite.py @@ -0,0 +1,28 @@ +import re + +from calibre.web.feeds.news import BasicNewsRecipe + +class Winsupersite(BasicNewsRecipe): + title = u'Supersite for Windows' + description = u'Paul Thurrott SuperSite for Windows' + publisher = 'Paul Thurrott' + __author__ = 'Hypernova' + language = _('English') + oldest_article = 30 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + remove_javascript = True + html2lrf_options = ['--ignore-tables'] + html2epub_options = 'linearize_tables = True' + remove_tags_before = dict(name='h1') + preprocess_regexps = [ + (re.compile(r'

--Paul Thurrott.*', re.DOTALL|re.IGNORECASE), + lambda match: ''), +] + def get_browser(self): + br = BasicNewsRecipe.get_browser() + br.open('http://www.winsupersite.com') + return br + + feeds = [(u'Supersite for Windows', u'http://www.winsupersite.com/supersite.xml')] From 376aac607dd4325d31b2de8c5107e837f6c71718 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 22 Feb 2009 06:17:24 -0800 Subject: [PATCH 15/22] New recipe for Borba by Darko Miletic --- src/calibre/gui2/images/news/borba.png | Bin 0 -> 365 bytes src/calibre/web/feeds/recipes/__init__.py | 2 +- src/calibre/web/feeds/recipes/recipe_borba.py | 92 ++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 src/calibre/gui2/images/news/borba.png create mode 100644 src/calibre/web/feeds/recipes/recipe_borba.py diff --git a/src/calibre/gui2/images/news/borba.png b/src/calibre/gui2/images/news/borba.png new file mode 100644 index 0000000000000000000000000000000000000000..41766d6264292c69e57d0ef533616dffc2e0f38f GIT binary patch literal 365 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDUH3oq+<1`SMITJ(xDKI!Q z^9&gLhXSAuAW+EXY6DV?N#5=*{1UquZUQ-+1s;*bK-vS0-A-oPfdtD69Mgd`*jk2| zV`~osIq{w@jv*Y^lP#Fpiq9D|ybQi7aBS8UV~1m%pB5i|qi{^~@TCSFfyZZ@+zv_^ zJQitYXxVtm;U`Z=;if+gN-j^%1gdI07MRRCMR5UhqR6T)X9-ruX9CAQZZZ`(HuI?i z8^er4!Qqc)1d0KzQY~?fC`m3#O)N>(O#u=NMg|6!x&}tNMn)lqCRT>VR>lU}1_o9J u2A@7{?}ll}%}>cpt3=gcXc}T*Vg*D-77z_i7MvA84Gf;HelF{r5}E)+hj@bk literal 0 HcmV?d00001 diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 579291a83b..8277338e18 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -31,7 +31,7 @@ recipe_modules = ['recipe_' + r for r in ( 'pobjeda', 'chicago_breaking_news', 'glasgow_herald', 'linuxdevices', 'hindu', 'cincinnati_enquirer', 'physics_world', 'pressonline', 'la_republica', 'physics_today', 'chicago_tribune', 'e_novine', - 'al_jazeera', 'winsupersite', + 'al_jazeera', 'winsupersite', 'borba', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_borba.py b/src/calibre/web/feeds/recipes/recipe_borba.py new file mode 100644 index 0000000000..a7d8d9f0a4 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_borba.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +borba.rs +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class Borba(BasicNewsRecipe): + title = 'Borba Online' + __author__ = 'Darko Miletic' + description = 'Dnevne novine Borba Online' + publisher = 'IP Novine Borba' + category = 'news, politics, Serbia' + language = _('Serbian') + oldest_article = 1 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'utf8' + remove_javascript = True + use_embedded_content = False + cover_url = 'http://www.borba.rs/images/stories/novine/naslovna_v.jpg' + INDEX = u'http://www.borba.rs/' + extra_css = '@font-face {font-family: "serif0";src:url(res:///Data/FONT/serif0.ttf)} @font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} body{font-family: serif0, serif1, serif} .article_description{font-family: serif0, serif1, serif}' + + html2lrf_options = [ + '--comment', description + , '--category', category + , '--publisher', publisher + , '--ignore-tables' + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_tables=True' + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + keep_only_tags = [dict(name='div', attrs={'class':'main'})] + + remove_tags_after = dict(name='div',attrs={'id':'written_comments_title'}) + + remove_tags = [ + dict(name=['object','link','iframe','base','img']) + ,dict(name='div',attrs={'id':'written_comments_title'}) + ] + + feeds = [ + (u'Najnovije vesti', u'http://www.borba.rs/content/blogsection/28/105/') + ,(u'Prvi plan' , u'http://www.borba.rs/content/blogsection/4/92/' ) + ,(u'Dogadjaji' , u'http://www.borba.rs/content/blogsection/21/83/' ) + ,(u'Ekonomija' , u'http://www.borba.rs/content/blogsection/5/35/' ) + ,(u'Komentari' , u'http://www.borba.rs/content/blogsection/23/94/' ) + ,(u'Svet' , u'http://www.borba.rs/content/blogsection/7/36/' ) + ,(u'Sport' , u'http://www.borba.rs/content/blogsection/6/37/' ) + ,(u'Fama' , u'http://www.borba.rs/content/blogsection/25/89/' ) + ,(u'B2 Dodatak' , u'http://www.borba.rs/content/blogsection/30/116/') + ] + + def preprocess_html(self, soup): + soup.html['xml:lang'] = 'sr-Latn-ME' + soup.html['lang'] = 'sr-Latn-ME' + mtag = '' + soup.head.insert(0,mtag) + for item in soup.findAll(style=True): + del item['style'] + for item in soup.findAll(font=True): + del item['font'] + return soup + + def parse_index(self): + totalfeeds = [] + lfeeds = self.get_feeds() + for feedobj in lfeeds: + feedtitle, feedurl = feedobj + self.report_progress(0, _('Fetching feed')+' %s...'%(feedtitle if feedtitle else feedurl)) + articles = [] + soup = self.index_to_soup(feedurl) + for item in soup.findAll('a', attrs={'class':'contentpagetitle'}): + url = item['href'] + title = self.tag_to_string(item) + articles.append({ + 'title' :title + ,'date' :'' + ,'url' :url + ,'description':'' + }) + totalfeeds.append((feedtitle, articles)) + return totalfeeds + From 47066604250bf2efae70245208a9e0747635f7a0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 22 Feb 2009 08:18:17 -0800 Subject: [PATCH 16/22] IGN:... --- src/calibre/ebooks/epub/iterator.py | 4 +++- src/calibre/ebooks/oeb/transforms/flatcss.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/epub/iterator.py b/src/calibre/ebooks/epub/iterator.py index 5601e9b8de..e953cbda51 100644 --- a/src/calibre/ebooks/epub/iterator.py +++ b/src/calibre/ebooks/epub/iterator.py @@ -98,7 +98,7 @@ class EbookIterator(object): url = re.compile(r'url\s*\([\'"]*(.+?)[\'"]*\)', re.DOTALL).search(block) if url: path = url.group(1).split('/') - path = os.path.join(os.path.dirname(item.path), *path) + path = os.path.join(os.path.dirname(item.path), *path) id = QFontDatabase.addApplicationFont(path) if id != -1: families = [unicode(f) for f in QFontDatabase.applicationFontFamilies(id)] @@ -106,6 +106,8 @@ class EbookIterator(object): family = family.group(1).strip().replace('"', '') if family not in families: print 'WARNING: Family aliasing not supported:', block + else: + print 'Loaded embedded font:', repr(family) def __enter__(self): self._tdir = TemporaryDirectory('_ebook_iter') diff --git a/src/calibre/ebooks/oeb/transforms/flatcss.py b/src/calibre/ebooks/oeb/transforms/flatcss.py index 01afcb08e2..ee7d7fa0b2 100644 --- a/src/calibre/ebooks/oeb/transforms/flatcss.py +++ b/src/calibre/ebooks/oeb/transforms/flatcss.py @@ -43,7 +43,7 @@ class KeyMapper(object): sign = -1 if size < base else 1 endp = 0 if size < base else 36 diff = (abs(base - size) * 3) + ((36 - size) / 100) - logb = abs(base - endp) + logb = abs(base - endp) result = sign * math.log(diff, logb) return result From 4a8811f6910201665886247e6133d4ca6b94424f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 22 Feb 2009 09:21:12 -0800 Subject: [PATCH 17/22] Fix #1804 (calibredb list - with umlauts in title) and return valid metadata for PRC files that have no EXTH record --- src/calibre/ebooks/mobi/reader.py | 2 +- src/calibre/library/cli.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index c22f3271f5..6d26c81789 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -505,7 +505,7 @@ def get_metadata(stream): except: import traceback traceback.print_exc() - return mi + return mi def option_parser(): diff --git a/src/calibre/library/cli.py b/src/calibre/library/cli.py index e170842293..164f865dca 100644 --- a/src/calibre/library/cli.py +++ b/src/calibre/library/cli.py @@ -174,6 +174,9 @@ def do_list(db, fields, sort_by, ascending, search_text, line_width, separator, return template.generate(data=data).render('xml') elif output_format == 'stanza': data = [i for i in data if i.has_key('fmt_epub')] + for x in data: + if isinstance(x['fmt_epub'], unicode): + x['fmt_epub'] = x['fmt_epub'].encode('utf-8') template = MarkupTemplate(STANZA_TEMPLATE) return template.generate(id="urn:calibre:main", data=data, subtitle=subtitle, sep=os.sep, quote=quote, updated=db.last_modified()).render('xml') From 91087fa3bd80577ac54ed19161bd292e962531fb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 22 Feb 2009 16:43:51 -0800 Subject: [PATCH 18/22] Fix handling of commas in author name when sending books to device. Fixes #1914 (author name scrambled?) --- src/calibre/devices/interface.py | 5 ++++- src/calibre/devices/prs505/books.py | 4 ++-- src/calibre/ebooks/metadata/opf2.py | 8 ++++---- src/calibre/gui2/dialogs/config.py | 7 ++++--- src/calibre/gui2/library.py | 20 +++++++++++--------- src/calibre/gui2/main.py | 19 +++++++------------ 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/calibre/devices/interface.py b/src/calibre/devices/interface.py index 6bbb658f2c..ed51962236 100644 --- a/src/calibre/devices/interface.py +++ b/src/calibre/devices/interface.py @@ -150,10 +150,13 @@ class Device(object): the device. @param locations: Result of a call to L{upload_books} @param metadata: List of dictionaries. Each dictionary must have the - keys C{title}, C{authors}, C{cover}, C{tags}. The value of the C{cover} + keys C{title}, C{authors}, C{author_sort}, C{cover}, C{tags}. + The value of the C{cover} element can be None or a three element tuple (width, height, data) where data is the image data in JPEG format as a string. C{tags} must be a possibly empty list of strings. C{authors} must be a string. + C{author_sort} may be None. It is upto the driver to decide whether to + use C{author_sort} or not. The dictionary can also have an optional key "tag order" which should be another dictionary that maps tag names to lists of book ids. The ids are ids from the book database. diff --git a/src/calibre/devices/prs505/books.py b/src/calibre/devices/prs505/books.py index 06d205fb02..38b708a312 100644 --- a/src/calibre/devices/prs505/books.py +++ b/src/calibre/devices/prs505/books.py @@ -55,7 +55,7 @@ class Book(object): title = book_metadata_field("title") authors = book_metadata_field("author", \ - formatter=lambda x: x if x and x.strip() else "Unknown") + formatter=lambda x: x if x and x.strip() else _('Unknown')) mime = book_metadata_field("mime") rpath = book_metadata_field("path") id = book_metadata_field("id", formatter=int) @@ -193,7 +193,7 @@ class BookList(_BookList): attrs = { "title" : info["title"], 'titleSorter' : sortable_title(info['title']), - "author" : info["authors"] if info['authors'] else 'Unknown', \ + "author" : info["authors"] if info['authors'] else _('Unknown'), "page":"0", "part":"0", "scale":"0", \ "sourceid":sourceid, "id":str(cid), "date":"", \ "mime":mime, "path":name, "size":str(size) diff --git a/src/calibre/ebooks/metadata/opf2.py b/src/calibre/ebooks/metadata/opf2.py index 2e3b5ff047..c172d26e1a 100644 --- a/src/calibre/ebooks/metadata/opf2.py +++ b/src/calibre/ebooks/metadata/opf2.py @@ -18,7 +18,7 @@ from calibre.ebooks.chardet import xml_to_unicode from calibre import relpath from calibre.constants import __appname__, __version__ from calibre.ebooks.metadata.toc import TOC -from calibre.ebooks.metadata import MetaInformation +from calibre.ebooks.metadata import MetaInformation, string_to_authors class Resource(object): @@ -614,7 +614,7 @@ class OPF(object): def fget(self): ans = [] for elem in self.authors_path(self.metadata): - ans.extend([x.strip() for x in self.get_text(elem).split(',')]) + ans.extend(string_to_authors(self.get_text(elem))) return ans def fset(self, val): @@ -624,8 +624,8 @@ class OPF(object): for author in val: attrib = {'{%s}role'%self.NAMESPACES['opf']: 'aut'} elem = self.create_metadata_element('creator', attrib=attrib) - self.set_text(elem, author) - + self.set_text(elem, author.strip()) + return property(fget=fget, fset=fset) @apply diff --git a/src/calibre/gui2/dialogs/config.py b/src/calibre/gui2/dialogs/config.py index bbd5475e2b..2b093a45b5 100644 --- a/src/calibre/gui2/dialogs/config.py +++ b/src/calibre/gui2/dialogs/config.py @@ -180,11 +180,12 @@ class ConfigDialog(QDialog, Ui_Dialog): self.toolbar_button_size.setCurrentIndex(0 if icons == self.ICON_SIZES[0] else 1 if icons == self.ICON_SIZES[1] else 2) self.show_toolbar_text.setChecked(config['show_text_in_toolbar']) - for ext in BOOK_EXTENSIONS: + book_exts = sorted(BOOK_EXTENSIONS) + for ext in book_exts: self.single_format.addItem(ext.upper(), QVariant(ext)) single_format = config['save_to_disk_single_format'] - self.single_format.setCurrentIndex(BOOK_EXTENSIONS.index(single_format)) + self.single_format.setCurrentIndex(book_exts.index(single_format)) self.cover_browse.setValue(config['cover_flow_queue_length']) self.systray_notifications.setChecked(not config['disable_tray_notification']) from calibre.translations.compiled import translations @@ -203,7 +204,7 @@ class ConfigDialog(QDialog, Ui_Dialog): self.pdf_metadata.setChecked(prefs['read_file_metadata']) added_html = False - for ext in BOOK_EXTENSIONS: + for ext in book_exts: ext = ext.lower() ext = re.sub(r'(x{0,1})htm(l{0,1})', 'html', ext) if ext == 'lrf' or is_supported('book.'+ext): diff --git a/src/calibre/gui2/library.py b/src/calibre/gui2/library.py index 1868623787..38652ad971 100644 --- a/src/calibre/gui2/library.py +++ b/src/calibre/gui2/library.py @@ -20,6 +20,7 @@ from calibre.gui2 import NONE, TableView, qstring_to_unicode, config, \ error_dialog from calibre.utils.search_query_parser import SearchQueryParser from calibre.ebooks.metadata.meta import set_metadata as _set_metadata +from calibre.ebooks.metadata import string_to_authors class LibraryDelegate(QItemDelegate): COLOR = QColor("blue") @@ -364,12 +365,13 @@ class BooksModel(QAbstractTableModel): return data - def get_metadata(self, rows, rows_are_ids=False): - metadata = [] + def get_metadata(self, rows, rows_are_ids=False, full_metadata=False): + metadata, _full_metadata = [], [] if not rows_are_ids: rows = [self.db.id(row.row()) for row in rows] for id in rows: mi = self.db.get_metadata(id, index_is_id=True) + _full_metadata.append(mi) au = authors_to_string(mi.authors if mi.authors else [_('Unknown')]) tags = mi.tags if mi.tags else [] if mi.series is not None: @@ -377,6 +379,7 @@ class BooksModel(QAbstractTableModel): info = { 'title' : mi.title, 'authors' : au, + 'author_sort' : mi.author_sort, 'cover' : self.db.cover(id, index_is_id=True), 'tags' : tags, 'comments': mi.comments, @@ -387,7 +390,10 @@ class BooksModel(QAbstractTableModel): } metadata.append(info) - return metadata + if full_metadata: + return metadata, _full_metadata + else: + return metadata def get_preferred_formats_from_ids(self, ids, all_formats, mode='r+b'): ans = [] @@ -928,12 +934,8 @@ class DeviceBooksModel(BooksModel): au = self.unknown if role == Qt.EditRole: return QVariant(au) - au = au.split(',') - authors = [] - for i in au: - authors += i.strip().split('&') - jau = [ a.strip() for a in authors ] - return QVariant("\n".join(jau)) + authors = string_to_authors(au) + return QVariant("\n".join(authors)) elif col == 2: size = self.db[self.map[row]].size return QVariant(BooksView.human_readable(size)) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index b4049fc739..3972e00bdd 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -1,3 +1,4 @@ +from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal ' import os, sys, textwrap, collections, traceback, time @@ -910,12 +911,13 @@ class Main(MainWindow, Ui_MainWindow): if not self.device_manager or not rows or len(rows) == 0: return ids = iter(self.library_view.model().id(r) for r in rows) - metadata = self.library_view.model().get_metadata(rows) + metadata, full_metadata = self.library_view.model().get_metadata( + rows, full_metadata=True) for mi in metadata: cdata = mi['cover'] if cdata: mi['cover'] = self.cover_to_thumbnail(cdata) - metadata = iter(metadata) + metadata, full_metadata = iter(metadata), iter(full_metadata) _files = self.library_view.model().get_preferred_formats(rows, self.device_manager.device_class.FORMATS, paths=True, set_metadata=True, @@ -923,22 +925,15 @@ class Main(MainWindow, Ui_MainWindow): files = [getattr(f, 'name', None) for f in _files] bad, good, gf, names, remove_ids = [], [], [], [], [] for f in files: - mi = metadata.next() + mi, smi = metadata.next(), full_metadata.next() id = ids.next() if f is None: bad.append(mi['title']) else: remove_ids.append(id) - aus = mi['authors'].split(',') - aus2 = [] - for a in aus: - aus2.extend(a.split('&')) try: - smi = MetaInformation(mi['title'], aus2) - smi.comments = mi.get('comments', None) - _f = open(f, 'r+b') - set_metadata(_f, smi, f.rpartition('.')[2]) - _f.close() + with open(f, 'r+b') as _f: + set_metadata(_f, smi, f.rpartition('.')[2]) except: print 'Error setting metadata in book:', mi['title'] traceback.print_exc() From 6abae014b2ef1f181bb065df1d02bd3c4c2130d3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 Feb 2009 10:14:42 -0800 Subject: [PATCH 19/22] Add support for sending Topaz books to the Kindle --- src/calibre/devices/kindle/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/devices/kindle/driver.py b/src/calibre/devices/kindle/driver.py index 0da1f55c5e..f9f87028ae 100755 --- a/src/calibre/devices/kindle/driver.py +++ b/src/calibre/devices/kindle/driver.py @@ -10,7 +10,7 @@ from calibre.devices.usbms.driver import USBMS class KINDLE(USBMS): # Ordered list of supported formats - FORMATS = ['azw', 'mobi', 'prc', 'txt'] + FORMATS = ['azw', 'mobi', 'prc', 'azw1', 'tpz', 'txt'] VENDOR_ID = [0x1949] PRODUCT_ID = [0x0001] From 70cb798e3235505aef394025484f4719c8a00e65 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 Feb 2009 10:16:28 -0800 Subject: [PATCH 20/22] IGN:... --- src/calibre/library/database2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index bf94144571..1e88a670f4 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -1147,7 +1147,7 @@ class LibraryDatabase2(LibraryDatabase): path = pt.name else: path = path_or_stream - return run_plugins_on_import(path, format) + return run_plugins_on_import(path, format) def add_books(self, paths, formats, metadata, uris=[], add_duplicates=True): ''' From 7dba0088e8bcfd55cbbb46f6dbd7b59c08d34703 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 Feb 2009 10:45:31 -0800 Subject: [PATCH 21/22] Fix bug causing add books to report spurious duplicates on OS X --- src/calibre/gui2/add.py | 92 +++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/src/calibre/gui2/add.py b/src/calibre/gui2/add.py index a6c6c699e8..a1a4607525 100644 --- a/src/calibre/gui2/add.py +++ b/src/calibre/gui2/add.py @@ -90,19 +90,25 @@ class AddFiles(Add): def run(self): - self.canceled = False - for c, book in enumerate(self.paths): - if self.pd.canceled: - self.canceled = True - break - format = os.path.splitext(book)[1] - format = format[1:] if format else None - stream = open(book, 'rb') - self.formats.append(format) - self.names.append(os.path.basename(book)) - self.get_metadata(c, stream, stream_type=format, - use_libprs_metadata=True) - self.wait_for_condition() + try: + self.canceled = False + for c, book in enumerate(self.paths): + if self.pd.canceled: + self.canceled = True + break + format = os.path.splitext(book)[1] + format = format[1:] if format else None + stream = open(book, 'rb') + self.formats.append(format) + self.names.append(os.path.basename(book)) + self.get_metadata(c, stream, stream_type=format, + use_libprs_metadata=True) + self.wait_for_condition() + finally: + self.disconnect(self.get_metadata, + SIGNAL('metadata(PyQt_PyObject, PyQt_PyObject)'), + self.metadata_delivered) + self.get_metadata = None def process_duplicates(self): @@ -178,34 +184,40 @@ class AddRecursive(Add): def run(self): - root = os.path.abspath(self.path) - for dirpath in os.walk(root): - if self.is_canceled(): - return - self.emit(SIGNAL('update(PyQt_PyObject)'), - _('Searching in')+' '+dirpath[0]) - self.books += list(self.db.find_books_in_directory(dirpath[0], - self.single_book_per_directory)) - self.books = [formats for formats in self.books if formats] - # Reset progress bar - self.emit(SIGNAL('searching_done()')) - - for c, formats in enumerate(self.books): - self.get_metadata.from_formats(c, formats) - self.wait_for_condition() + try: + root = os.path.abspath(self.path) + for dirpath in os.walk(root): + if self.is_canceled(): + return + self.emit(SIGNAL('update(PyQt_PyObject)'), + _('Searching in')+' '+dirpath[0]) + self.books += list(self.db.find_books_in_directory(dirpath[0], + self.single_book_per_directory)) + self.books = [formats for formats in self.books if formats] + # Reset progress bar + self.emit(SIGNAL('searching_done()')) + + for c, formats in enumerate(self.books): + self.get_metadata.from_formats(c, formats) + self.wait_for_condition() + + # Add books to database + for c, x in enumerate(self.metadata): + mi, formats = x + if self.is_canceled(): + break + if self.db.has_book(mi): + self.duplicates.append((mi, formats)) + else: + self.db.import_book(mi, formats, notify=False) + self.number_of_books_added += 1 + self.emit(SIGNAL('pupdate(PyQt_PyObject)'), c) + finally: + self.disconnect(self.get_metadata, + SIGNAL('metadataf(PyQt_PyObject, PyQt_PyObject)'), + self.metadata_delivered) + self.get_metadata = None - # Add books to database - for c, x in enumerate(self.metadata): - mi, formats = x - if self.is_canceled(): - break - if self.db.has_book(mi): - self.duplicates.append((mi, formats)) - else: - self.db.import_book(mi, formats, notify=False) - self.number_of_books_added += 1 - self.emit(SIGNAL('pupdate(PyQt_PyObject)'), c) - def process_duplicates(self): if self.duplicates: From f4047dfdf1e6e7ecddfb115a48623d5d888698ef Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 Feb 2009 11:30:45 -0800 Subject: [PATCH 22/22] IGN:Updated translations --- src/calibre/translations/ar.po | 549 ++++++++++++++------------- src/calibre/translations/bg.po | 549 ++++++++++++++------------- src/calibre/translations/ca.po | 549 ++++++++++++++------------- src/calibre/translations/cs.po | 549 ++++++++++++++------------- src/calibre/translations/de.po | 639 +++++++++++++++++--------------- src/calibre/translations/el.po | 549 ++++++++++++++------------- src/calibre/translations/es.po | 551 ++++++++++++++------------- src/calibre/translations/fr.po | 549 ++++++++++++++------------- src/calibre/translations/gl.po | 549 ++++++++++++++------------- src/calibre/translations/hu.po | 549 ++++++++++++++------------- src/calibre/translations/it.po | 553 ++++++++++++++------------- src/calibre/translations/nb.po | 549 ++++++++++++++------------- src/calibre/translations/nds.po | 639 +++++++++++++++++--------------- src/calibre/translations/nl.po | 549 ++++++++++++++------------- src/calibre/translations/pl.po | 549 ++++++++++++++------------- src/calibre/translations/pt.po | 549 ++++++++++++++------------- src/calibre/translations/ro.po | 549 ++++++++++++++------------- src/calibre/translations/ru.po | 549 ++++++++++++++------------- src/calibre/translations/sk.po | 557 ++++++++++++++-------------- src/calibre/translations/sl.po | 549 ++++++++++++++------------- src/calibre/translations/sv.po | 549 ++++++++++++++------------- src/calibre/translations/te.po | 549 ++++++++++++++------------- 22 files changed, 6399 insertions(+), 5873 deletions(-) diff --git a/src/calibre/translations/ar.po b/src/calibre/translations/ar.po index 36f803cad2..a0b7a73969 100644 --- a/src/calibre/translations/ar.po +++ b/src/calibre/translations/ar.po @@ -7,14 +7,14 @@ msgid "" msgstr "" "Project-Id-Version: calibre\n" "Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2009-02-13 20:29+0000\n" +"POT-Creation-Date: 2009-02-19 00:09+0000\n" "PO-Revision-Date: 2009-02-04 10:04+0000\n" "Last-Translator: عبد الله شلي (Abdellah Chelli) \n" "Language-Team: Arabic \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-02-18 20:12+0000\n" +"X-Launchpad-Export-Date: 2009-02-23 19:12+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 @@ -23,14 +23,14 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:44 #: /home/kovid/work/calibre/src/calibre/ebooks/epub/from_any.py:71 -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:499 -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:1015 -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:1031 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:517 #: /home/kovid/work/calibre/src/calibre/ebooks/html.py:1033 -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:77 -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:79 -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:81 -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:86 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:1049 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:1051 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:78 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:80 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:82 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:87 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/comic/convert_from.py:295 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/fb2/convert_from.py:61 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/fb2/convert_from.py:95 @@ -57,7 +57,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:36 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:60 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:118 -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:487 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:491 #: /home/kovid/work/calibre/src/calibre/ebooks/odt/to_oeb.py:46 #: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:569 #: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:574 @@ -77,9 +77,9 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:121 #: /home/kovid/work/calibre/src/calibre/gui2/library.py:364 #: /home/kovid/work/calibre/src/calibre/gui2/library.py:376 -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:894 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:937 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:940 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:897 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:949 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:952 #: /home/kovid/work/calibre/src/calibre/gui2/tools.py:61 #: /home/kovid/work/calibre/src/calibre/gui2/tools.py:123 #: /home/kovid/work/calibre/src/calibre/library/cli.py:257 @@ -456,7 +456,7 @@ msgid "" "Extract the contents of the produced EPUB file to the specified directory." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/epub/from_any.py:184 +#: /home/kovid/work/calibre/src/calibre/ebooks/epub/from_any.py:186 msgid "" "%%prog [options] filename\n" "\n" @@ -479,14 +479,14 @@ msgid "" "the element of the OPF file. \n" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/epub/from_html.py:478 +#: /home/kovid/work/calibre/src/calibre/ebooks/epub/from_html.py:480 #: /home/kovid/work/calibre/src/calibre/ebooks/lit/writer.py:758 -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:613 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:623 msgid "Output written to " msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/epub/from_html.py:500 -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:1118 +#: /home/kovid/work/calibre/src/calibre/ebooks/epub/from_html.py:502 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:1136 msgid "You must specify an input HTML file" msgstr "" @@ -505,88 +505,88 @@ msgid "" "cause incorrect rendering." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:511 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:529 msgid "Written processed HTML to " msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:899 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:917 msgid "Options to control the traversal of HTML" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:906 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:924 msgid "The output directory. Default is the current directory." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:908 -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:560 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:926 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:570 msgid "Character encoding for HTML files. Default is to auto detect." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:910 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:928 msgid "" "Create the output in a zip file. If this option is specified, the --output " "should be the name of a file not a directory." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:912 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:930 msgid "Control the following of links in HTML files." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:914 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:932 msgid "" "Traverse links in HTML files breadth first. Normally, they are traversed " "depth first" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:916 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:934 msgid "" "Maximum levels of recursion when following links in HTML files. Must be non-" "negative. 0 implies that no links in the root HTML file are followed." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:918 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:936 msgid "Set metadata of the generated ebook" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:920 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:938 msgid "Set the title. Default is to autodetect." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:922 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:940 msgid "The author(s) of the ebook, as a & separated list." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:924 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:942 msgid "The subject(s) of this book, as a comma separated list." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:926 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:944 msgid "Set the publisher of this book." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:928 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:946 msgid "A summary of this book." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:930 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:948 msgid "Load metadata from the specified OPF file" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:932 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:950 msgid "Options useful for debugging" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:934 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:952 msgid "" "Be more verbose while processing. Can be specified multiple times to " "increase verbosity." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:936 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:954 msgid "Output HTML is \"pretty printed\" for easier parsing by humans" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:942 +#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:960 msgid "" "%prog [options] file.html|opf\n" "\n" @@ -607,7 +607,7 @@ msgid "%prog [options] LITFILE" msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/lit/reader.py:855 -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:511 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:515 msgid "Output directory. Defaults to current directory." msgstr "" @@ -617,12 +617,12 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/lit/reader.py:861 #: /home/kovid/work/calibre/src/calibre/ebooks/lit/writer.py:731 -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:572 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:582 msgid "Useful for debugging." msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/lit/reader.py:872 -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:535 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:539 msgid "OEB ebook created in" msgstr "" @@ -632,192 +632,192 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/lit/writer.py:728 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/from_feeds.py:26 -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:569 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:579 msgid "Output file. Default is derived from input filename." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:74 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:75 msgid "Set the title. Default: filename." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:76 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:77 msgid "" "Set the author(s). Multiple authors should be set as a comma separated list. " "Default: %default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:79 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:80 msgid "Set the comment." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:81 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:82 msgid "Set the category" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:83 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:84 msgid "Sort key for the title" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:85 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:86 msgid "Sort key for the author" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:87 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:88 #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/__init__.py:288 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/fetch_metadata.py:39 #: /home/kovid/work/calibre/src/calibre/gui2/library.py:110 msgid "Publisher" msgstr "ناشر" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:89 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:90 msgid "Path to file containing image to be used as cover" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:91 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:92 msgid "" "If there is a cover graphic detected in the source file, use that instead of " "the specified cover." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:94 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:95 msgid "Output file name. Default is derived from input filename" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:96 -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:544 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:97 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:554 msgid "" "Render HTML tables as blocks of text instead of actual tables. This is " "neccessary if the HTML contains very large or complex tables." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:99 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:100 msgid "" "Specify the base font size in pts. All fonts are rescaled accordingly. This " "option obsoletes the --font-delta option and takes precedence over it. To " "use --font-delta, set this to 0. Default: %defaultpt" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:101 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:102 msgid "Enable autorotation of images that are wider than the screen width." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:104 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:105 msgid "Set the space between words in pts. Default is %default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:106 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:107 msgid "Separate paragraphs by blank lines." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:108 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:109 msgid "Add a header to all the pages with title and author." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:110 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:111 msgid "" "Set the format of the header. %a is replaced by the author and %t by the " "title. Default is %default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:112 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:113 msgid "Add extra spacing below the header. Default is %default px." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:114 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:115 msgid "" "Override the CSS. Can be either a path to a CSS stylesheet or a string. If " "it is a string it is interpreted as CSS." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:116 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:117 msgid "" "Use the element from the OPF file to determine the order in which " "the HTML files are appended to the LRF. The .opf file must be in the same " "directory as the base HTML file." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:118 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:119 msgid "" "Minimum paragraph indent (the indent of the first line of a paragraph) in " "pts. Default: %default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:120 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:121 msgid "" "Increase the font size by 2 * FONT_DELTA pts and the line spacing by " "FONT_DELTA pts. FONT_DELTA can be a fraction.If FONT_DELTA is negative, the " "font size is decreased." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:125 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:126 msgid "" "Render all content as black on white instead of the colors specified by the " "HTML or CSS." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:131 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:132 msgid "" "Profile of the target device for which this LRF is being generated. The " "profile determines things like the resolution and screen size of the target " "device. Default: %s Supported profiles: " msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:137 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:138 msgid "Left margin of page. Default is %default px." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:139 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:140 msgid "Right margin of page. Default is %default px." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:141 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:142 msgid "Top margin of page. Default is %default px." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:143 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:144 msgid "Bottom margin of page. Default is %default px." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:145 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:146 msgid "" "Render tables in the HTML as images (useful if the document has large or " "complex tables)" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:147 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:148 msgid "" "Multiply the size of text in rendered tables by this factor. Default is " "%default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:152 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:153 msgid "" "The maximum number of levels to recursively process links. A value of 0 " "means thats links are not followed. A negative value means that tags are " "ignored." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:156 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:157 msgid "" "A regular expression. tags whose href matches will be ignored. Defaults " "to %default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:160 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:161 msgid "Don't add links to the table of contents." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:164 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:165 msgid "Prevent the automatic detection chapters." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:167 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:168 msgid "" "The regular expression used to detect chapter titles. It is searched for in " "heading tags (h1-h6). Defaults to %default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:170 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:171 msgid "" "Detect a chapter beginning at an element having the specified attribute. The " "format for this option is tagname regexp,attribute name,attribute value " @@ -827,7 +827,7 @@ msgid "" "all h2 tags, you would use \"h2,none,\". Default is %default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:172 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:173 msgid "" "If html2lrf does not find any page breaks in the html file and cannot detect " "chapter headings, it will automatically insert page-breaks before the tags " @@ -838,12 +838,12 @@ msgid "" "has only a few elements." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:182 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:183 msgid "" "Force a page break before tags whose names match this regular expression." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:184 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:185 msgid "" "Force a page break before an element having the specified attribute. The " "format for this option is tagname regexp,attribute name,attribute value " @@ -851,25 +851,25 @@ msgid "" "class=\"chapter\" you would use \"h\\d,class,chapter\". Default is %default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:187 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:188 msgid "Add detected chapters to the table of contents." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:190 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:191 msgid "Preprocess Baen HTML files to improve generated LRF." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:192 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:193 msgid "" "You must add this option if processing files generated by pdftohtml, " "otherwise conversion will fail." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:194 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:195 msgid "Use this option on html0 files from Book Designer." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:197 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:198 msgid "" "Specify trutype font families for serif, sans-serif and monospace fonts. " "These fonts will be embedded in the LRF file. Note that custom fonts lead to " @@ -877,33 +877,33 @@ msgid "" " " msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:205 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:206 msgid "The serif family of fonts to embed" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:208 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:209 msgid "The sans-serif family of fonts to embed" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:211 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:212 msgid "The monospace family of fonts to embed" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:215 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:216 msgid "Be verbose while processing" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:217 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:218 msgid "Convert to LRS" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:219 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:220 msgid "" "Minimize memory usage at the cost of longer processing times. Use this " "option if you are on a memory constrained machine." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:221 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:222 msgid "" "Specify the character encoding of the source file. If the output LRF file " "contains strange characters, try changing this option. A common encoding for " @@ -1391,7 +1391,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/fetch_metadata.py:36 #: /home/kovid/work/calibre/src/calibre/gui2/library.py:105 #: /home/kovid/work/calibre/src/calibre/gui2/library.py:361 -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:964 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:967 msgid "Title" msgstr "" @@ -1399,7 +1399,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/fetch_metadata.py:37 #: /home/kovid/work/calibre/src/calibre/gui2/library.py:106 #: /home/kovid/work/calibre/src/calibre/gui2/library.py:366 -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:965 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:968 msgid "Author(s)" msgstr "" @@ -1421,8 +1421,8 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/__init__.py:292 #: /home/kovid/work/calibre/src/calibre/gui2/library.py:111 #: /home/kovid/work/calibre/src/calibre/gui2/library.py:311 -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:904 -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:968 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:907 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:971 #: /home/kovid/work/calibre/src/calibre/gui2/status.py:60 #: /home/kovid/work/calibre/src/calibre/gui2/tags.py:50 msgid "Tags" @@ -1441,7 +1441,7 @@ msgid "Language" msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/__init__.py:297 -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:903 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:906 msgid "Timestamp" msgstr "" @@ -1573,65 +1573,65 @@ msgstr "" msgid "Creating Mobipocket file from EPUB..." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:509 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:513 msgid "%prog [options] myebook.mobi" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:533 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:537 msgid "Raw MOBI HTML saved in" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:528 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:538 msgid "Options to control the conversion to MOBI" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:535 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:545 msgid "Mobipocket-specific options." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:537 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:547 msgid "" "Compress file text using PalmDOC compression. Results in smaller files, but " "takes a long time to run." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:540 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:550 msgid "Modify images to meet Palm device size limitations." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:542 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:552 msgid "Title for any generated in-line table of contents." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:548 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:558 msgid "" "When present, use the author sorting information for generating the " "Mobipocket author metadata." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:550 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:560 msgid "" "Device renderer profiles. Affects conversion of font sizes, image rescaling " "and rasterization of tables. Valid profiles are: %s." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:555 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:565 msgid "Source renderer profile. Default is %default." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:558 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:568 msgid "Destination renderer profile. Default is %default." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:566 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:576 msgid "[options]" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:584 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:594 msgid "Unknown source profile %r" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:588 +#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:598 msgid "Unknown destination profile %r" msgstr "" @@ -1871,7 +1871,7 @@ msgid "Adding books to database..." msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/add.py:177 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:700 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:703 msgid "Reading metadata..." msgstr "" @@ -1915,7 +1915,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/book_info.py:85 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/book_info.py:86 #: /home/kovid/work/calibre/src/calibre/gui2/library.py:318 -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:899 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:902 #: /home/kovid/work/calibre/src/calibre/gui2/status.py:56 msgid "Path" msgstr "" @@ -2097,7 +2097,7 @@ msgid "Access log:" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config.py:345 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:406 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:409 msgid "Failed to start content server" msgstr "" @@ -2135,7 +2135,7 @@ msgid "Compacting..." msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config_ui.py:417 -#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:340 +#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:345 msgid "Configuration" msgstr "" @@ -2172,10 +2172,10 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles_ui.py:267 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles_ui.py:269 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/user_profiles_ui.py:270 -#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:329 -#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:333 -#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:339 -#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:341 +#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:334 +#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:338 +#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:344 +#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:346 msgid "..." msgstr "" @@ -2521,7 +2521,7 @@ msgid " is not a valid picture" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/epub.py:241 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:1048 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:1060 msgid "Cannot convert" msgstr "" @@ -3222,26 +3222,26 @@ msgstr "" msgid "The cover in the %s format is invalid" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single.py:323 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single.py:325 msgid "" "

Enter your username and password for LibraryThing.com.
If you " "do not have one, you can
register " "for free!.

" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single.py:353 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single.py:355 msgid "Could not fetch cover.
" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single.py:353 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single.py:355 msgid "Could not fetch cover" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single.py:359 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single.py:361 msgid "Cannot fetch cover" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single.py:359 +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single.py:361 msgid "You must specify the ISBN identifier for this book." msgstr "" @@ -3895,12 +3895,12 @@ msgid "Job has already run" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/library.py:107 -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:966 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:969 msgid "Size (MB)" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/library.py:108 -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:967 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:970 msgid "Date" msgstr "" @@ -3918,21 +3918,21 @@ msgstr "" msgid "Book %s of %s." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:734 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:737 msgid "Not allowed" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:735 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:738 msgid "" "Dropping onto a device is not supported. First add the book to the calibre " "library." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:898 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:901 msgid "Format" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/library.py:1001 +#: /home/kovid/work/calibre/src/calibre/gui2/library.py:1004 msgid "Search (For Advanced Search click the button to the left)" msgstr "" @@ -4049,107 +4049,107 @@ msgstr "" msgid "and delete from library" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:160 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:163 msgid "Send to storage card by default" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:169 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:172 msgid "Edit metadata individually" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:171 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:174 msgid "Edit metadata in bulk" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:174 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:177 msgid "Add books from a single directory" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:175 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:178 msgid "" "Add books from directories, including sub-directories (One book per " "directory, assumes every ebook file is the same book in a different format)" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:176 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:179 msgid "" "Add books from directories, including sub directories (Multiple books per " "directory, assumes every ebook file is a different book)" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:191 -#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:353 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:194 +#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:358 msgid "Save to disk" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:192 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:195 msgid "Save to disk in a single directory" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:193 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:1255 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:196 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:1267 msgid "Save only %s format to disk" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:196 -#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:359 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:199 +#: /home/kovid/work/calibre/src/calibre/gui2/main_ui.py:364 msgid "View" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:197 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:200 msgid "View specific format" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:214 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:217 msgid "Convert individually" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:215 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:218 msgid "Bulk convert" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:217 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:220 msgid "Set defaults for conversion" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:218 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:221 msgid "Set defaults for conversion of comics" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:240 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:243 msgid "Similar books..." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:288 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:291 msgid "Bad database location" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:290 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:1395 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:293 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:1407 msgid "Choose a location for your ebook library." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:445 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:448 msgid "Browse by covers" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:535 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:538 msgid "Device: " msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:536 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:539 msgid " detected." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:558 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:561 msgid "Connected " msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:569 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:572 msgid "Device database corrupted" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:570 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:573 msgid "" "\n" "

The database of books on the reader is corrupted. Try the " @@ -4165,410 +4165,418 @@ msgid "" " " msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:661 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:713 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:664 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:716 msgid "Uploading books to device." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:669 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:672 msgid "Books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:670 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:673 msgid "EPUB Books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:671 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:674 msgid "LRF Books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:672 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:675 msgid "HTML Books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:673 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:676 msgid "LIT Books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:674 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:677 msgid "MOBI Books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:675 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:678 msgid "Text books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:676 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:679 msgid "PDF Books" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:677 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:680 msgid "Comics" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:678 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:681 msgid "Archives" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:699 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:702 msgid "Adding books..." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:742 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:745 msgid "No space on device" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:743 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:746 msgid "" "

Cannot upload books to device there is no more free space available " msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:775 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:778 msgid "" "The selected books will be permanently deleted and the files removed " "from your computer. Are you sure?" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:787 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:790 msgid "Deleting books from device." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:818 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:843 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:821 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:846 msgid "Cannot edit metadata" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:818 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:843 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:969 -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:1048 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:821 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:846 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:981 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:1060 msgid "No books selected" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:894 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:897 msgid "Sending news to device." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:948 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:900 +msgid "Choose format to send to device" +msgstr "" + +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:960 msgid "Sending books to device." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:951 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:963 msgid "No suitable formats" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:952 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:964 msgid "" "Could not upload the following books to the device, as no suitable formats " "were found:

    %s
" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:969 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:981 msgid "Cannot save to disk" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:973 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:985 msgid "Saving to disk..." msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:978 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:990 msgid "Saved" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:984 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:996 msgid "Choose destination directory" msgstr "" -#: /home/kovid/work/calibre/src/calibre/gui2/main.py:998 +#: /home/kovid/work/calibre/src/calibre/gui2/main.py:1010 msgid "" "

Could not save the following books to disk, because the %s format is not " "available for them: