From b9521c819d0a45c5d47ac7eb18b4b636f16e8dc1 Mon Sep 17 00:00:00 2001 From: GRiker Date: Thu, 28 Jan 2010 06:47:41 -0700 Subject: [PATCH] GwR revisions for mastheadImage, Catalog tweaks --- src/calibre/gui2/catalog/catalog_epub_mobi.ui | 81 +++++++++++++------ src/calibre/gui2/dialogs/catalog.ui | 2 +- src/calibre/web/feeds/news.py | 3 + 3 files changed, 59 insertions(+), 27 deletions(-) diff --git a/src/calibre/gui2/catalog/catalog_epub_mobi.ui b/src/calibre/gui2/catalog/catalog_epub_mobi.ui index 858aec429f..044ecdaaec 100644 --- a/src/calibre/gui2/catalog/catalog_epub_mobi.ui +++ b/src/calibre/gui2/catalog/catalog_epub_mobi.ui @@ -14,19 +14,6 @@ Form - - - - Tags to exclude as genres (regex): - - - Qt::LogText - - - true - - - @@ -37,7 +24,7 @@ - + @@ -51,7 +38,7 @@ - + @@ -65,18 +52,67 @@ - + - + + + + Sort numbers as text + + + + - + - + + + + Regex pattern describing tags to exclude as genres: + + + Qt::LogText + + + true + + + + + + + + 14 + 75 + true + + + + Special marker tags for catalog generation + + + Qt::AlignCenter + + + + + + + Regex tips: +- The default regex of '\[[\w]*\]' ignores tags of the form '[tag]', e.g., '[Amazon Freebie]' +- A regex of '.' ignores all tags, generating no genre categories in the catalog + + + true + + + + Qt::Vertical @@ -89,13 +125,6 @@ - - - - Sort numbers as text - - - diff --git a/src/calibre/gui2/dialogs/catalog.ui b/src/calibre/gui2/dialogs/catalog.ui index c18e08ef65..3d62f36e85 100644 --- a/src/calibre/gui2/dialogs/catalog.ui +++ b/src/calibre/gui2/dialogs/catalog.ui @@ -107,7 +107,7 @@ 12 12 - 205 + 301 17 diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index 3328445fd8..00869409ea 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -872,6 +872,8 @@ class BasicNewsRecipe(Recipe): image_ext = name.rpartition('.')[2].lower() if image_ext in ['jpg','jpeg']: return name + if image_ext not in ['gif']: + raise RuntimeError("web.feeds.news:BasicNewsRecipe.convert_image(): '%s' is not a supported mastheadImage format" % image_ext) import calibre.utils.PythonMagickWand as p img = p.NewMagickWand() if img < 0: @@ -880,6 +882,7 @@ class BasicNewsRecipe(Recipe): self.log.warn('Failed to read image:', name) name = name.replace('.%s' % image_ext, '.jpg') p.MagickWriteImage(img, name) + p.DestroyMagickWand(img) return name def _download_masthead(self):