From c9f64d8deb15c2b1a2670a73e5bb7579cbe1ce28 Mon Sep 17 00:00:00 2001 From: GRiker Date: Sat, 7 Jul 2012 04:15:07 -0600 Subject: [PATCH] Backed out changes passing DEBUG to spawned catalog building task. Added debug_pipeline directive (commented out) for manual inspection of generated catalog code pre-conversion. --- src/calibre/gui2/convert/gui_conversion.py | 3 +-- src/calibre/gui2/tools.py | 3 +-- src/calibre/library/catalogs/epub_mobi.py | 13 +++++-------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/calibre/gui2/convert/gui_conversion.py b/src/calibre/gui2/convert/gui_conversion.py index 1ebf211c57..ce51d4ca77 100644 --- a/src/calibre/gui2/convert/gui_conversion.py +++ b/src/calibre/gui2/convert/gui_conversion.py @@ -31,7 +31,7 @@ def gui_convert_override(input, output, recommendations, notification=DummyRepor override_input_metadata=True) def gui_catalog(fmt, title, dbspec, ids, out_file_name, sync, fmt_options, connected_device, - debug_mode, notification=DummyReporter(), log=None): + notification=DummyReporter(), log=None): if log is None: log = Log() from calibre.library import db @@ -50,7 +50,6 @@ def gui_catalog(fmt, title, dbspec, ids, out_file_name, sync, fmt_options, conne # opts.gui_search_text = something opts.catalog_title = title opts.connected_device = connected_device - opts.debug_mode = debug_mode opts.ids = ids opts.search_text = None opts.sort_by = None diff --git a/src/calibre/gui2/tools.py b/src/calibre/gui2/tools.py index e4c8eeeddb..e915545d1a 100644 --- a/src/calibre/gui2/tools.py +++ b/src/calibre/gui2/tools.py @@ -320,8 +320,7 @@ def generate_catalog(parent, dbspec, ids, device_manager, db): # {{{ out.name, d.catalog_sync, d.fmt_options, - connected_device, - DEBUG + connected_device ] out.close() diff --git a/src/calibre/library/catalogs/epub_mobi.py b/src/calibre/library/catalogs/epub_mobi.py index dc750e4b92..81cb247236 100644 --- a/src/calibre/library/catalogs/epub_mobi.py +++ b/src/calibre/library/catalogs/epub_mobi.py @@ -276,8 +276,6 @@ class EPUB_MOBI(CatalogPlugin): log.error("coercing thumb_width from '%s' to '%s'" % (opts.thumb_width,self.THUMB_SMALLEST)) opts.thumb_width = "1.0" - if opts.debug_mode: - setattr(opts, 'debug_pipeline', os.path.expanduser("~/Desktop/Catalog debug")) # Display opts keys = opts_dict.keys() @@ -285,7 +283,7 @@ class EPUB_MOBI(CatalogPlugin): build_log.append(" opts:") for key in keys: if key in ['catalog_title','authorClip','connected_kindle','descriptionClip', - 'debug_pipeline','exclude_book_marker','exclude_genre','exclude_tags', + 'exclude_book_marker','exclude_genre','exclude_tags', 'header_note_source_field','merge_comments', 'output_profile','read_book_marker', 'search_text','sort_by','sort_descriptions_by_author','sync', @@ -317,11 +315,10 @@ class EPUB_MOBI(CatalogPlugin): recommendations = [] recommendations.append(('remove_fake_margins', False, OptionRecommendation.HIGH)) - if opts.debug_mode: - recommendations.append(('comments', '\n'.join(line for line in build_log), - OptionRecommendation.HIGH)) - else: - recommendations.append(('comments', '', OptionRecommendation.HIGH)) + recommendations.append(('comments', '', OptionRecommendation.HIGH)) + + # Use to debug generated catalog code before conversion + #setattr(opts,'debug_pipeline',os.path.expanduser("~/Desktop/Catalog debug")) dp = getattr(opts, 'debug_pipeline', None) if dp is not None: