From f8c29071f21ad71f3f646fc8fd7a4446da8e16db Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 16 Mar 2012 11:05:43 +0530 Subject: [PATCH] Let the inspect mobi tool accept and process multiple filenames at once --- src/calibre/debug.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/calibre/debug.py b/src/calibre/debug.py index 26b5002aa2..13cccd3e01 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -51,8 +51,9 @@ Run an embedded python interpreter. 'with sqlite3 works.') parser.add_option('-p', '--py-console', help='Run python console', default=False, action='store_true') - parser.add_option('-m', '--inspect-mobi', - help='Inspect the MOBI file at the specified path', default=None) + parser.add_option('-m', '--inspect-mobi', action='store_true', + default=False, + help='Inspect the MOBI file(s) at the specified path(s)') parser.add_option('--test-build', help='Test binary modules in build', action='store_true', default=False) @@ -232,9 +233,13 @@ def main(args=sys.argv): if len(args) > 1 and os.access(args[-1], os.R_OK): sql_dump = args[-1] reinit_db(opts.reinitialize_db, sql_dump=sql_dump) - elif opts.inspect_mobi is not None: + elif opts.inspect_mobi: from calibre.ebooks.mobi.debug import inspect_mobi - inspect_mobi(opts.inspect_mobi) + for path in args[1:]: + prints('Inspecting:', path) + inspect_mobi(path) + print + elif opts.test_build: from calibre.test_build import test test()