From fb9d0302415f8b72f297878d0eb885a5ace502fc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 23 Jul 2009 19:15:35 -0600 Subject: [PATCH 1/5] Misc. minor fixes --- src/calibre/ebooks/lrf/html/convert_from.py | 6 ++++++ src/calibre/ebooks/metadata/opf2.py | 4 +++- src/calibre/ebooks/pdf/manipulate/crop.py | 10 +++++----- src/calibre/gui2/wizard/__init__.py | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index 515ec4182d..bab56e3a58 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -1891,6 +1891,12 @@ def process_file(path, options, logger): if options.header: header = Paragraph() fheader = options.headerformat + if not options.title: + options.title = _('Unknown') + if not options.author: + options.author = _('Unknown') + if not fheader: + fheader = "%t by %a" fheader = re.sub(r'(? Date: Fri, 24 Jul 2009 14:27:42 -0600 Subject: [PATCH 2/5] Ebook viewer: Display EPUB covers again --- src/calibre/customize/conversion.py | 4 ++++ src/calibre/ebooks/epub/input.py | 4 ++-- src/calibre/ebooks/oeb/iterator.py | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/calibre/customize/conversion.py b/src/calibre/customize/conversion.py index 4f2b279f85..273bb9ebf7 100644 --- a/src/calibre/customize/conversion.py +++ b/src/calibre/customize/conversion.py @@ -109,6 +109,10 @@ class InputFormatPlugin(Plugin): #: convenience method, :method:`get_image_collection`. is_image_collection = False + #: If set to True, the input plugin will perform special processing + #: to make its output suitable for viewing + for_viewer = False + #: Options shared by all Input format plugins. Do not override #: in sub-classes. Use :member:`options` instead. Every option must be an #: instance of :class:`OptionRecommendation`. diff --git a/src/calibre/ebooks/epub/input.py b/src/calibre/ebooks/epub/input.py index 3f8b563d96..fd1e4733e1 100644 --- a/src/calibre/ebooks/epub/input.py +++ b/src/calibre/ebooks/epub/input.py @@ -53,7 +53,6 @@ class EPUBInput(InputFormatPlugin): traceback.print_exc() return False - @classmethod def rationalize_cover(self, opf, log): guide_cover, guide_elem = None, None for guide_elem in opf.iterguide(): @@ -78,7 +77,8 @@ class EPUBInput(InputFormatPlugin): # Remove from spine as covers must be treated # specially - spine[0].getparent().remove(spine[0]) + if not self.for_viewer: + spine[0].getparent().remove(spine[0]) guide_elem.set('href', 'calibre_raster_cover.jpg') from calibre.ebooks.oeb.base import OPF t = etree.SubElement(elem[0].getparent(), OPF('item'), diff --git a/src/calibre/ebooks/oeb/iterator.py b/src/calibre/ebooks/oeb/iterator.py index 4910bf4e10..9b9158b37e 100644 --- a/src/calibre/ebooks/oeb/iterator.py +++ b/src/calibre/ebooks/oeb/iterator.py @@ -134,6 +134,7 @@ class EbookIterator(object): if hasattr(plumber.opts, 'no_process'): plumber.opts.no_process = True + plumber.input_plugin.for_viewer = True self.pathtoopf = plumber.input_plugin(open(plumber.input, 'rb'), plumber.opts, plumber.input_fmt, self.log, {}, self.base) From 4643668b6f1daedda0e380a07b0aca1e28f516a7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 24 Jul 2009 19:43:45 -0600 Subject: [PATCH 3/5] version 0.6.0 --- src/calibre/web/feeds/recipes/recipe_bbc.py | 17 ++++++++++++----- upload.py | 7 +++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/calibre/web/feeds/recipes/recipe_bbc.py b/src/calibre/web/feeds/recipes/recipe_bbc.py index bc893c5ad4..0c9c5f60c2 100644 --- a/src/calibre/web/feeds/recipes/recipe_bbc.py +++ b/src/calibre/web/feeds/recipes/recipe_bbc.py @@ -10,16 +10,20 @@ from calibre.web.feeds.news import BasicNewsRecipe class BBC(BasicNewsRecipe): title = u'The BBC' - __author__ = 'Kovid Goyal' + __author__ = 'Kovid Goyal and Sujata Raman' description = 'Global news and current affairs from the British Broadcasting Corporation' - no_stylesheets = True language = _('English') - remove_tags = [dict(name='div', attrs={'class':'footer'})] - extra_css = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt }' + remove_tags = [dict(name='div', attrs={'class':'footer'}),] + + + extra_css = ''' + body{font-family:Arial,Helvetica,sans-serif; font-size:small;} + h1{font-size:large;} + ''' feeds = [ - ('News Front Page', 'http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml'), + ('News Front Page', 'http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml'), ('Science/Nature', 'http://newsrss.bbc.co.uk/rss/newsonline_world_edition/science/nature/rss.xml'), ('Technology', 'http://newsrss.bbc.co.uk/rss/newsonline_world_edition/technology/rss.xml'), ('Enterntainment', 'http://newsrss.bbc.co.uk/rss/newsonline_world_edition/entertainment/rss.xml'), @@ -34,5 +38,8 @@ class BBC(BasicNewsRecipe): ('Africa', 'http://newsrss.bbc.co.uk/rss/newsonline_world_edition/africa/rss.xml'), ] + def print_version(self, url): return url.replace('http://', 'http://newsvote.bbc.co.uk/mpapps/pagetools/print/') + + diff --git a/upload.py b/upload.py index 45dbac0bd6..c0be14aa46 100644 --- a/upload.py +++ b/upload.py @@ -44,7 +44,7 @@ except: def newer(targets, sources): ''' - Return True is sources is newer that targets or if targets + Return True if sources is newer that targets or if targets does not exist. ''' for f in targets: @@ -786,7 +786,10 @@ try: mkup = '
    %s
' self.current_entry.description = mkup%(''.join( self.current_entry.description)) - + if match.group(1) == '0.6.0': + self.current_entry.description = \ + '''
See New in + 6
''' self.rss.items.append(self.current_entry) timestamp = r.rev.timezone + r.rev.timestamp self.current_entry = RSSItem( From 8e7d2a2ee8f276f6277134eb6d2b498fe9dffdd1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 24 Jul 2009 19:51:57 -0600 Subject: [PATCH 4/5] IGN:Tag release --- src/calibre/constants.py | 2 +- src/calibre/library/server.py | 3 +- src/calibre/translations/calibre.pot | 102 +++++++++++++++------------ 3 files changed, 59 insertions(+), 48 deletions(-) diff --git a/src/calibre/constants.py b/src/calibre/constants.py index 7e38f3c47f..297a38e82d 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.6.0b17' +__version__ = '0.6.0' __author__ = "Kovid Goyal " import re diff --git a/src/calibre/library/server.py b/src/calibre/library/server.py index 0a13800f75..d0ea9e962e 100644 --- a/src/calibre/library/server.py +++ b/src/calibre/library/server.py @@ -8,6 +8,7 @@ HTTP server for remote access to the calibre database. ''' import sys, textwrap, operator, os, re, logging, cStringIO +import __builtin__ from itertools import repeat from logging.handlers import RotatingFileHandler from datetime import datetime @@ -352,7 +353,7 @@ class LibraryServer(object): book, books = MarkupTemplate(self.BOOK), [] for record in items[start:start+num]: - aus = record[2] if record[2] else __builtins__._('Unknown') + aus = record[2] if record[2] else __builtin__._('Unknown') authors = '|'.join([i.replace('|', ',') for i in aus.split(',')]) record[10] = fmt_sidx(float(record[10])) books.append(book.generate(r=record, authors=authors).render('xml').decode('utf-8')) diff --git a/src/calibre/translations/calibre.pot b/src/calibre/translations/calibre.pot index c8b030f776..68e73035c8 100644 --- a/src/calibre/translations/calibre.pot +++ b/src/calibre/translations/calibre.pot @@ -4,9 +4,9 @@ # msgid "" msgstr "" -"Project-Id-Version: calibre 0.6.0b16\n" -"POT-Creation-Date: 2009-07-22 07:39+MDT\n" -"PO-Revision-Date: 2009-07-22 07:39+MDT\n" +"Project-Id-Version: calibre 0.6.0\n" +"POT-Creation-Date: 2009-07-24 19:49+MDT\n" +"PO-Revision-Date: 2009-07-24 19:49+MDT\n" "Last-Translator: Automatically generated\n" "Language-Team: LANGUAGE\n" "MIME-Version: 1.0\n" @@ -33,6 +33,8 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/fb2/input.py:52 #: /home/kovid/work/calibre/src/calibre/ebooks/html/input.py:317 #: /home/kovid/work/calibre/src/calibre/ebooks/html/input.py:320 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/html/convert_from.py:1895 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/html/convert_from.py:1897 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/output.py:24 #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/__init__.py:225 #: /home/kovid/work/calibre/src/calibre/ebooks/metadata/__init__.py:256 @@ -63,11 +65,11 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:736 #: /home/kovid/work/calibre/src/calibre/ebooks/odt/input.py:44 #: /home/kovid/work/calibre/src/calibre/ebooks/odt/input.py:46 -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:857 -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:862 -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:900 -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/reader.py:136 -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/reader.py:138 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:866 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:871 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:909 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/reader.py:135 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/reader.py:137 #: /home/kovid/work/calibre/src/calibre/ebooks/oeb/transforms/jacket.py:84 #: /home/kovid/work/calibre/src/calibre/ebooks/pdb/ereader/writer.py:103 #: /home/kovid/work/calibre/src/calibre/ebooks/pdb/ereader/writer.py:104 @@ -128,8 +130,8 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/library/database2.py:1599 #: /home/kovid/work/calibre/src/calibre/library/database2.py:1621 #: /home/kovid/work/calibre/src/calibre/library/database2.py:1672 -#: /home/kovid/work/calibre/src/calibre/library/server.py:294 -#: /home/kovid/work/calibre/src/calibre/library/server.py:355 +#: /home/kovid/work/calibre/src/calibre/library/server.py:295 +#: /home/kovid/work/calibre/src/calibre/library/server.py:356 #: /home/kovid/work/calibre/src/calibre/utils/podofo/__init__.py:45 #: /home/kovid/work/calibre/src/calibre/utils/podofo/__init__.py:63 #: /home/kovid/work/calibre/src/calibre/utils/podofo/__init__.py:77 @@ -204,19 +206,19 @@ msgstr "" msgid "Conversion Input" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/conversion.py:118 +#: /home/kovid/work/calibre/src/calibre/customize/conversion.py:122 msgid "Save the output from the input plugin to the specified directory. Useful if you are unsure at which stage of the conversion process a bug is occurring. WARNING: This completely deletes the contents of the specified directory." msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/conversion.py:127 +#: /home/kovid/work/calibre/src/calibre/customize/conversion.py:131 msgid "Specify the character encoding of the input document. If set this option will override any encoding declared by the document itself. Particularly useful for documents that do not declare an encoding or that have erroneous encoding declarations." msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/conversion.py:243 +#: /home/kovid/work/calibre/src/calibre/customize/conversion.py:247 msgid "Conversion Output" msgstr "" -#: /home/kovid/work/calibre/src/calibre/customize/conversion.py:257 +#: /home/kovid/work/calibre/src/calibre/customize/conversion.py:261 msgid "If specified, the output plugin will try to create output that is as human readable as possible. May not have any effect for some output plugins." msgstr "" @@ -1009,7 +1011,7 @@ msgstr "" msgid "Cannot read from: %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/html/convert_from.py:1990 +#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/html/convert_from.py:1996 msgid "Failed to process opf file" msgstr "" @@ -1384,8 +1386,8 @@ msgid "" "Fetch a cover image for the book identified by ISBN from LibraryThing.com\n" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/metadata/opf2.py:1053 -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1260 +#: /home/kovid/work/calibre/src/calibre/ebooks/metadata/opf2.py:1055 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1269 msgid "Cover" msgstr "" @@ -1414,70 +1416,70 @@ msgstr "" msgid "All articles" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1261 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1270 msgid "Title Page" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1262 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1271 #: /home/kovid/work/calibre/src/calibre/ebooks/oeb/transforms/htmltoc.py:15 #: /home/kovid/work/calibre/src/calibre/gui2/viewer/main.py:48 #: /home/kovid/work/calibre/src/calibre/gui2/viewer/main_ui.py:168 msgid "Table of Contents" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1263 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1272 msgid "Index" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1264 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1273 msgid "Glossary" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1265 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1274 msgid "Acknowledgements" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1266 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1275 msgid "Bibliography" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1267 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1276 msgid "Colophon" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1268 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1277 msgid "Copyright" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1269 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1278 msgid "Dedication" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1270 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1279 msgid "Epigraph" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1271 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1280 msgid "Foreword" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1272 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1281 msgid "List of Illustrations" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1273 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1282 msgid "List of Tables" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1274 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1283 msgid "Notes" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1275 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1284 msgid "Preface" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1276 +#: /home/kovid/work/calibre/src/calibre/ebooks/oeb/base.py:1285 msgid "Main Text" msgstr "" @@ -1537,11 +1539,11 @@ msgstr "" msgid "Generate an Adobe \"page-map\" file if pagination information is available." msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/pdb/ereader/reader132.py:112 +#: /home/kovid/work/calibre/src/calibre/ebooks/pdb/ereader/reader132.py:114 msgid "Footnotes" msgstr "" -#: /home/kovid/work/calibre/src/calibre/ebooks/pdb/ereader/reader132.py:121 +#: /home/kovid/work/calibre/src/calibre/ebooks/pdb/ereader/reader132.py:123 msgid "Sidebar" msgstr "" @@ -3584,8 +3586,7 @@ msgid "Meta information" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk_ui.py:141 -#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single_ui.py:341 -msgid "Author S&ort: " +msgid "Author s&ort: " msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk_ui.py:142 @@ -3611,7 +3612,7 @@ msgid " stars" msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk_ui.py:148 -msgid "Add Ta&gs: " +msgid "Add ta&gs: " msgstr "" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_bulk_ui.py:150 @@ -3718,6 +3719,10 @@ msgstr "" msgid "Swap the author and title" msgstr "" +#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single_ui.py:341 +msgid "Author S&ort: " +msgstr "" + #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/metadata_single_ui.py:343 msgid "Automatically create the author sort entry based on the current author entry" msgstr "" @@ -5953,11 +5958,11 @@ msgstr "" msgid "Compacting database" msgstr "" -#: /home/kovid/work/calibre/src/calibre/library/server.py:146 +#: /home/kovid/work/calibre/src/calibre/library/server.py:147 msgid "Password to access your calibre library. Username is " msgstr "" -#: /home/kovid/work/calibre/src/calibre/library/server.py:429 +#: /home/kovid/work/calibre/src/calibre/library/server.py:430 msgid "" "[options]\n" "\n" @@ -6226,12 +6231,14 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_accountancyage.py:25 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_adventuregamers.py:13 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_adventuregamers.py:18 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_al_jazeera.py:15 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_amspec.py:14 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_ap.py:11 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_ars_technica.py:13 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_atlantic.py:17 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_azstarnet.py:15 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_barrons.py:18 -#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_bbc.py:16 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_bbc.py:15 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_business_week.py:16 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_chicago_breaking_news.py:22 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_chicago_tribune.py:17 @@ -6239,6 +6246,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_cincinnati_enquirer.py:10 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_climate_progress.py:23 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_cnn.py:15 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_coding_horror.py:17 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_common_dreams.py:8 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_corriere_della_sera_en.py:23 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_craigslist.py:15 @@ -6276,8 +6284,10 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_krstarica_en.py:23 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_latimes.py:17 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_linux_magazine.py:16 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_linuxdevices.py:19 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_lrb.py:17 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_miami_herald.py:19 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_moneynews.py:16 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_moscow_times.py:15 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_msdnmag_en.py:23 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_nasa.py:34 @@ -6303,14 +6313,17 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_science_news.py:15 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_sciencedaily.py:15 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_scientific_american.py:16 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_scott_hanselman.py:18 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_seattle_times.py:22 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_security_watch.py:15 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_shacknews.py:10 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_slashdot.py:15 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_slate.py:18 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_smh.py:19 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_soldiers.py:26 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_spiegel_int.py:17 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_st_petersburg_times.py:23 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_stackoverflow.py:18 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_starbulletin.py:19 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_straitstimes.py:22 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_telegraph_uk.py:18 @@ -6336,7 +6349,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_wash_post.py:12 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_wikinews_en.py:23 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_winsupersite.py:10 -#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_wired.py:15 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_wired.py:14 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_wsj.py:16 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_xkcd.py:15 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_zdnet.py:16 @@ -6399,6 +6412,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_estadao.py:62 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_jb_online.py:47 #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_o_globo.py:69 +#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_publico.py:20 msgid "Portugese" msgstr "" @@ -6420,10 +6434,6 @@ msgstr "" msgid "Skipping filtered article: %s" msgstr "" -#: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_publico.py:20 -msgid "Portuguese" -msgstr "" - #: #: /home/kovid/work/calibre/src/calibre/web/feeds/recipes/recipe_usatoday.py:18 msgid "Kovid Goyal and Sujata Raman" From 27a78ef8519138218a6585c57aac844368301d08 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 24 Jul 2009 20:46:57 -0600 Subject: [PATCH 5/5] Try to eject unmounted devices in linux. Misc. fixes --- src/calibre/devices/usbms/device.py | 24 +++++++++++++++--------- upload.py | 14 +++----------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index 499352c483..8bbfd58043 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -571,6 +571,7 @@ class Device(DeviceConfig, DevicePlugin): def eject_linux(self): drives = self.find_device_nodes() + success = False for drive in drives: if drive: cmd = ['pumount', '-l'] @@ -580,15 +581,20 @@ class Device(DeviceConfig, DevicePlugin): pass while p.poll() is None: time.sleep(0.1) - if p.returncode == 0: - for x in ('_main_prefix', '_card_a_prefix', '_card_b_prefix'): - x = getattr(self, x, None) - if x is not None: - if x.startswith('/media/') and os.path.exists(x): - try: - shutil.rmtree(x) - except: - pass + success = success or p.returncode == 0 + try: + subprocess.Popen(['sudo', 'eject', drive]) + except: + pass + for x in ('_main_prefix', '_card_a_prefix', '_card_b_prefix'): + x = getattr(self, x, None) + if x is not None: + if x.startswith('/media/') and os.path.exists(x) \ + and not os.listdir(x): + try: + shutil.rmtree(x) + except: + pass def eject(self): diff --git a/upload.py b/upload.py index c0be14aa46..0bbe98e9fa 100644 --- a/upload.py +++ b/upload.py @@ -459,7 +459,7 @@ class upload_demo(OptionlessCommand): def run(self): check_call( '''ebook-convert %s/demo.html /tmp/html2lrf.lrf ''' - '''--title='Demonstration of html2lrf' --author='Kovid Goyal' ''' + '''--title='Demonstration of html2lrf' --authors='Kovid Goyal' ''' '''--header ''' '''--serif-family "/usr/share/fonts/corefonts, Times New Roman" ''' '''--mono-family "/usr/share/fonts/corefonts, Andale Mono" ''' @@ -471,15 +471,6 @@ class upload_demo(OptionlessCommand): check_call('scp /tmp/html-demo.zip divok:%s/'%(DOWNLOADS,), shell=True) - check_call( - ("ebook-convert %s/demo.txt /tmp/txt2lrf.lrf -t 'Demonstration of txt2lrf'" - "-a 'Kovid Goyal' --header ")%(TXT2LRF,), shell=True) - - check_call('cd src/calibre/ebooks/lrf/txt/demo/ && ' - 'zip -j /tmp/txt-demo.zip * /tmp/txt2lrf.lrf', shell=True) - - check_call('''scp /tmp/txt-demo.zip divok:%s/'''%(DOWNLOADS,), shell=True) - def installer_name(ext): if ext in ('exe', 'dmg'): @@ -762,6 +753,7 @@ try: class ChangelogFormatter(blog.LogFormatter): supports_tags = True supports_merge_revisions = False + _show_advice = False def __init__(self, num_of_versions=20): from calibre.utils.rss_gen import RSS2 @@ -786,7 +778,7 @@ try: mkup = '
    %s
' self.current_entry.description = mkup%(''.join( self.current_entry.description)) - if match.group(1) == '0.6.0': + if match.group(1) == '0.5.14': self.current_entry.description = \ ''''''