mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
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.
This commit is contained in:
parent
c17c2f96ec
commit
c9f64d8deb
@ -31,7 +31,7 @@ def gui_convert_override(input, output, recommendations, notification=DummyRepor
|
|||||||
override_input_metadata=True)
|
override_input_metadata=True)
|
||||||
|
|
||||||
def gui_catalog(fmt, title, dbspec, ids, out_file_name, sync, fmt_options, connected_device,
|
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:
|
if log is None:
|
||||||
log = Log()
|
log = Log()
|
||||||
from calibre.library import db
|
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.gui_search_text = something
|
||||||
opts.catalog_title = title
|
opts.catalog_title = title
|
||||||
opts.connected_device = connected_device
|
opts.connected_device = connected_device
|
||||||
opts.debug_mode = debug_mode
|
|
||||||
opts.ids = ids
|
opts.ids = ids
|
||||||
opts.search_text = None
|
opts.search_text = None
|
||||||
opts.sort_by = None
|
opts.sort_by = None
|
||||||
|
@ -320,8 +320,7 @@ def generate_catalog(parent, dbspec, ids, device_manager, db): # {{{
|
|||||||
out.name,
|
out.name,
|
||||||
d.catalog_sync,
|
d.catalog_sync,
|
||||||
d.fmt_options,
|
d.fmt_options,
|
||||||
connected_device,
|
connected_device
|
||||||
DEBUG
|
|
||||||
]
|
]
|
||||||
out.close()
|
out.close()
|
||||||
|
|
||||||
|
@ -276,8 +276,6 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
log.error("coercing thumb_width from '%s' to '%s'" % (opts.thumb_width,self.THUMB_SMALLEST))
|
log.error("coercing thumb_width from '%s' to '%s'" % (opts.thumb_width,self.THUMB_SMALLEST))
|
||||||
opts.thumb_width = "1.0"
|
opts.thumb_width = "1.0"
|
||||||
|
|
||||||
if opts.debug_mode:
|
|
||||||
setattr(opts, 'debug_pipeline', os.path.expanduser("~/Desktop/Catalog debug"))
|
|
||||||
|
|
||||||
# Display opts
|
# Display opts
|
||||||
keys = opts_dict.keys()
|
keys = opts_dict.keys()
|
||||||
@ -285,7 +283,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
build_log.append(" opts:")
|
build_log.append(" opts:")
|
||||||
for key in keys:
|
for key in keys:
|
||||||
if key in ['catalog_title','authorClip','connected_kindle','descriptionClip',
|
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',
|
'header_note_source_field','merge_comments',
|
||||||
'output_profile','read_book_marker',
|
'output_profile','read_book_marker',
|
||||||
'search_text','sort_by','sort_descriptions_by_author','sync',
|
'search_text','sort_by','sort_descriptions_by_author','sync',
|
||||||
@ -317,12 +315,11 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
recommendations = []
|
recommendations = []
|
||||||
recommendations.append(('remove_fake_margins', False,
|
recommendations.append(('remove_fake_margins', False,
|
||||||
OptionRecommendation.HIGH))
|
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)
|
dp = getattr(opts, 'debug_pipeline', None)
|
||||||
if dp is not None:
|
if dp is not None:
|
||||||
recommendations.append(('debug_pipeline', dp,
|
recommendations.append(('debug_pipeline', dp,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user