From 87659c76ae189fa4e74a9cbe1f7d902bce3d53de Mon Sep 17 00:00:00 2001 From: benton Date: Thu, 22 Jul 2021 10:15:17 -0500 Subject: [PATCH] nicer console output, doesn't overwrite preexisting epub file --- knock | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/knock b/knock index 29886cd..8ebc71d 100644 --- a/knock +++ b/knock @@ -18,6 +18,9 @@ args.activation_file = args.adobe_dir.joinpath('activation.xml') if not args.acsm_file.exists(): raise Exception(f'{str(args.acsm_file)} does not exist.') +if args.epub_file.exists(): + raise Exception(f'{str(args.epub_file)} already exists.') + if not args.adobe_dir.exists(): print('This device is not registered with Adobe.') email = input("Enter your Adobe account's email address: ") @@ -53,5 +56,4 @@ subprocess.check_output([ args.drm_file.unlink() -print(f'\nThe DRM-free EPUB file now exists at {str(args.epub_file)}!') -print(f'Once you make sure the EPUB file is readable, you can delete {str(args.acsm_file)}.') \ No newline at end of file +print(f'\nDRM-free EPUB file created:\n{str(args.epub_file)}') \ No newline at end of file