diff --git a/src/calibre/customize/ui.py b/src/calibre/customize/ui.py index ad321a1f83..f6ab19a910 100644 --- a/src/calibre/customize/ui.py +++ b/src/calibre/customize/ui.py @@ -49,7 +49,7 @@ def load_plugin(path_to_zip_file): :return: A :class:`Plugin` instance. ''' - print 'Loading plugin from', path_to_zip_file + #print 'Loading plugin from', path_to_zip_file if not os.access(path_to_zip_file, os.R_OK): raise PluginNotFound zf = ZipFile(path_to_zip_file) diff --git a/src/calibre/ebooks/conversion/cli.py b/src/calibre/ebooks/conversion/cli.py index f07c2d86ef..4c9b08df96 100644 --- a/src/calibre/ebooks/conversion/cli.py +++ b/src/calibre/ebooks/conversion/cli.py @@ -61,11 +61,6 @@ def check_command_line_options(parser, args, log): output = os.path.splitext(os.path.basename(input))[0]+output output = os.path.abspath(output) - if '.' in output: - if os.path.exists(output): - log.warn('WARNING:', output, 'exists. Deleting.') - os.remove(output) - return input, output def option_recommendation_to_cli_option(add_option, rec): @@ -187,22 +182,26 @@ class ProgressBar(object): percent = int(frac*100) self.log('%d%% %s'%(percent, msg)) -def main(args=sys.argv): - log = Log() - reporter = ProgressBar(log) +def create_option_parser(args, log): parser = option_parser() if len(args) < 3: print_help(parser, log) - return 1 + raise SystemExit(1) input, output = check_command_line_options(parser, args, log) from calibre.ebooks.conversion.plumber import Plumber + reporter = ProgressBar(log) plumber = Plumber(input, output, log, reporter) add_input_output_options(parser, plumber) add_pipeline_options(parser, plumber) + return parser, plumber + +def main(args=sys.argv): + log = Log() + parser, plumber = create_option_parser(args, log) opts = parser.parse_args(args)[0] y = lambda q : os.path.abspath(os.path.expanduser(q)) for x in ('read_metadata_from_opf', 'cover'): diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index 4a7f047a33..5010e9e8e8 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -303,7 +303,7 @@ class MobiReader(object): if root.xpath('descendant::p/descendant::p'): from lxml.html import soupparser self.log.warning('Markup contains unclosed

tags, parsing using', - 'BeatifulSoup') + 'BeatifulSoup') root = soupparser.fromstring(self.processed_html) self.upshift_markup(root) guides = root.xpath('//guide') diff --git a/src/calibre/linux.py b/src/calibre/linux.py index 61aca183d9..66847776dc 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -31,6 +31,7 @@ entry_points = { 'calibre-fontconfig = calibre.utils.fontconfig:main', 'calibre-parallel = calibre.parallel:main', 'calibre-customize = calibre.customize.ui:main', + 'calibre-complete = calibre.utils.complete:main', 'pdfmanipulate = calibre.ebooks.pdf.manipulate.cli:main', 'fetch-ebook-metadata = calibre.ebooks.metadata.fetch:main', 'calibre-smtp = calibre.utils.smtp:main', @@ -233,8 +234,9 @@ _prs500() ;; esac } -complete -o nospace -F _prs500 prs500 +complete -o nospace -F _prs500 ebook-device +complete -C calibre-complete ebook-convert ''') f.close() print 'done'