diff --git a/archive.py b/archive.py index eb6f76fb..57b858ef 100755 --- a/archive.py +++ b/archive.py @@ -57,7 +57,7 @@ def create_archive(export_file, service=None, resume=None): try: for link in links: dump_website(link, service) - except (KeyboardInterrupt, SystemExit, Exception): + except (KeyboardInterrupt, SystemExit, Exception) as e: print('{red}[X] Archive creation stopped.{reset}'.format(**ANSI)) print(' Continue where you left off by running:') print(' ./archive.py {} {} {}'.format( @@ -65,6 +65,8 @@ def create_archive(export_file, service=None, resume=None): service, link['timestamp'], )) + if not isinstance(e, KeyboardInterrupt): + raise e raise SystemExit(1) print('{}[√] [{}] Archive update complete.{}'.format(ANSI['green'], datetime.now().strftime('%Y-%m-%d %H:%M:%S'), ANSI['reset'])) diff --git a/config.py b/config.py index 9933a86e..8c84f976 100644 --- a/config.py +++ b/config.py @@ -168,7 +168,7 @@ def progress(seconds=TIMEOUT, prefix=''): def end(): """immediately finish progress and clear the progressbar line""" p.terminate() - sys.stdout.write('\r{}\r'.format(' ' * TERM_WIDTH)) # clear whole terminal line + sys.stdout.write('\r{}{}\r'.format((' ' * TERM_WIDTH), ANSI['reset'])) # clear whole terminal line sys.stdout.flush() return end