1
0
Fork 0
mirror of synced 2024-06-26 10:00:19 +12:00

dont hide real exceptions

This commit is contained in:
Nick Sweeting 2017-07-05 17:15:39 -05:00
parent 4db30779a3
commit 6bb91fbb45
2 changed files with 4 additions and 2 deletions

View file

@ -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']))

View file

@ -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