Fix #2372 (when converting .cbz files on OSX, Calibre chokes on OSX metadata files)

This commit is contained in:
Kovid Goyal 2009-05-01 10:18:18 -07:00
parent ad62a99f13
commit ec9111aa7f

View File

@ -70,6 +70,7 @@ def find_pages(dir, sort_on_mtime=False, verbose=False):
for datum in os.walk(dir): for datum in os.walk(dir):
for name in datum[-1]: for name in datum[-1]:
path = os.path.join(datum[0], name) path = os.path.join(datum[0], name)
if '__MACOSX' in path: continue
for ext in extensions: for ext in extensions:
if path.lower().endswith('.'+ext): if path.lower().endswith('.'+ext):
pages.append(path) pages.append(path)
@ -222,13 +223,12 @@ def render_pages(tasks, dest, opts, notification=None):
for num, path in tasks: for num, path in tasks:
try: try:
pages.extend(PageProcessor(path, dest, opts, num)) pages.extend(PageProcessor(path, dest, opts, num))
msg = _('Rendered %s') msg = _('Rendered %s')%path
except: except:
failures.append(path) failures.append(path)
msg = _('Failed %s') msg = _('Failed %s')%path
if opts.verbose: if opts.verbose:
msg += '\n' + traceback.format_exc() msg += '\n' + traceback.format_exc()
msg = msg%path
if notification is not None: if notification is not None:
notification(0.5, msg) notification(0.5, msg)