From 6c63444d275925e65fca8cefd00bfef6ecf8a816 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 7 Mar 2020 13:52:29 -0800 Subject: [PATCH] Use voussoirkit.getpermission. --- epubfile.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/epubfile.py b/epubfile.py index bd5ce1c..72b9f8a 100644 --- a/epubfile.py +++ b/epubfile.py @@ -10,6 +10,7 @@ import zipfile import bs4 import tinycss2 +from voussoirkit import getpermission from voussoirkit import pathclass HTML_LINK_PROPERTIES = { @@ -1472,10 +1473,7 @@ def merge( def merge_argparse(args): if os.path.exists(args.output): - ok = args.autoyes - if not ok: - ok = input(f'Overwrite {args.output}? y/n\n>').lower() in ('y', 'yes') - if not ok: + if not (args.autoyes or getpermission.getpermission(f'Overwrite {args.output}?')): raise ValueError(f'{args.output} exists.') return merge(