From fd90212e27a5c3d1d7554449781a77889dfcaa1d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 Sep 2008 14:26:50 -0700 Subject: [PATCH] Fix #1020 (Errors occuring during multiple add should not interrupt the process) --- src/calibre/gui2/main.py | 15 +++++++++++---- src/calibre/trac/bzr_commit_plugin.py | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index c5fb6ba86d..7154b2949d 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -507,14 +507,17 @@ in which you want to store your books files. Any existing books will be automati format = os.path.splitext(book)[1] format = format[1:] if format else None stream = open(book, 'rb') - mi = get_metadata(stream, stream_type=format, use_libprs_metadata=True) + try: + mi = get_metadata(stream, stream_type=format, use_libprs_metadata=True) + except: + mi = MetaInformation(None, None) if not mi.title: mi.title = os.path.splitext(os.path.basename(book))[0] + if not mi.authors: + mi.authors = [_('Unknown')] formats.append(format) metadata.append(mi) names.append(os.path.basename(book)) - if not mi.authors: - mi.authors = ['Unknown'] infos.append({'title':mi.title, 'authors':', '.join(mi.authors), 'cover':self.default_thumbnail, 'tags':[]}) @@ -524,7 +527,11 @@ in which you want to store your books files. Any existing books will be automati paths = list(paths) for i, path in enumerate(paths): if html_pat.search(path) is not None: - paths[i] = html2oeb(path) + try: + paths[i] = html2oeb(path) + except: + traceback.print_exc() + continue if paths[i] is None: paths[i] = path else: diff --git a/src/calibre/trac/bzr_commit_plugin.py b/src/calibre/trac/bzr_commit_plugin.py index 5efc68d566..8cd8b53d09 100644 --- a/src/calibre/trac/bzr_commit_plugin.py +++ b/src/calibre/trac/bzr_commit_plugin.py @@ -45,7 +45,7 @@ class cmd_commit(_cmd_commit): password = config.get_user_option(prefix+'password') close_bug = config.get_user_option(prefix+'pattern') if close_bug is None: - close_bug = r'(Fix|Implement)\s+#(\d+)' + close_bug = r'(Fix|Implement|Fixes|Fixed|Implemented)\s+#(\d+)' close_bug_pat = re.compile(close_bug, re.IGNORECASE) match = close_bug_pat.search(msg) if not match: