diff --git a/src/calibre/customize/__init__.py b/src/calibre/customize/__init__.py index 6466d198a0..68d94bf178 100644 --- a/src/calibre/customize/__init__.py +++ b/src/calibre/customize/__init__.py @@ -255,12 +255,14 @@ class CatalogPlugin(Plugin): def search_sort_db(self, db, opts): + ''' # Don't add Catalogs to the generated Catalogs cat = _('Catalog') if opts.search_text: opts.search_text += ' not tag:'+cat else: opts.search_text = 'not tag:'+cat + ''' db.search(opts.search_text) diff --git a/src/calibre/gui2/catalog/catalog_epub_mobi.py b/src/calibre/gui2/catalog/catalog_epub_mobi.py index 841ba5f6ad..4bc4d60e5c 100644 --- a/src/calibre/gui2/catalog/catalog_epub_mobi.py +++ b/src/calibre/gui2/catalog/catalog_epub_mobi.py @@ -17,7 +17,7 @@ class PluginWidget(QWidget,Ui_Form): TITLE = _('E-book Options') HELP = _('Options specific to')+' EPUB/MOBI '+_('output') OPTION_FIELDS = [('exclude_genre','\[[\w ]*\]'), - ('exclude_tags','~'), + ('exclude_tags','~,'+_('Catalog')), ('read_tag','+'), ('note_tag','*')] diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index b2e6fa0efc..fd9c36da02 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -247,7 +247,7 @@ class EPUB_MOBI(CatalogPlugin): help=_("Regex describing tags to exclude as genres.\n" "Default: '%default' excludes bracketed tags, e.g. '[]'\n" "Applies to: ePub, MOBI output formats")), Option('--exclude-tags', - default='~', + default=('~,'+_('Catalog')), dest='exclude_tags', help=_("Comma-separated list of tag words indicating book should be excluded from output. Case-insensitive.\n" "--exclude-tags=skip will match 'skip this book' and 'Skip will like this'.\n" @@ -758,7 +758,10 @@ class EPUB_MOBI(CatalogPlugin): if self.opts.ids: self.opts.search_text = search_phrase else: - self.opts.search_text = self.opts.search_text + " " + search_phrase + if self.opts.search_text: + self.opts.search_text += " " + search_phrase + else: + self.opts.search_text = search_phrase # Fetch the database as a dictionary data = self.plugin.search_sort_db(self.db, self.opts) @@ -2495,6 +2498,7 @@ class EPUB_MOBI(CatalogPlugin): pw.MagickThumbnailImage(thumb, 75, 100) pw.MagickWriteImage(thumb, os.path.join(image_dir, thumb_file)) pw.DestroyMagickWand(thumb) + pw.DestroyMagickWand(img) except IOError: print "generate_thumbnail() IOError with %s" % title['title'] except RuntimeError: