1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-03-31 17:33:32 +02:00

Fix flake8 issues in ui module.

This commit is contained in:
2020-09-06 18:26:57 +02:00
parent 6fdcc029bb
commit 11275651a2

View File

@@ -96,13 +96,16 @@ def _run_filetype_plugins(path_to_file, ft=None, occasion='preprocess'):
pass pass
try: try:
nfp = plugin.run(nfp) or nfp nfp = plugin.run(nfp) or nfp
except: except Exception:
print('Running file type plugin %s failed with traceback:' % print('Running file type plugin %s failed with traceback:' %
plugin.name, file=oe) plugin.name, file=oe)
traceback.print_exc(file=oe) traceback.print_exc(file=oe)
sys.stdout, sys.stderr = oo, oe sys.stdout, sys.stderr = oo, oe
x = lambda j: os.path.normpath(os.path.normcase(j))
if occasion == 'postprocess' and x(nfp) != x(path_to_file): def norm(string):
return os.path.normpath(os.path.normcase(string))
if occasion == 'postprocess' and norm(nfp) != norm(path_to_file):
shutil.copyfile(nfp, path_to_file) shutil.copyfile(nfp, path_to_file)
nfp = path_to_file nfp = path_to_file
return nfp return nfp