From 44bd6866ac3cb5d03585bbe324393e64075176ab Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 30 Jun 2020 01:48:41 -0400 Subject: [PATCH] colorize hints in CLI output more consistently --- archivebox/cli/logging.py | 11 ++++++----- archivebox/main.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/archivebox/cli/logging.py b/archivebox/cli/logging.py index 293c47cf..53a65664 100644 --- a/archivebox/cli/logging.py +++ b/archivebox/cli/logging.py @@ -19,10 +19,11 @@ from ..config import ( ConfigDict, PYTHON_ENCODING, ANSI, - OUTPUT_DIR, IS_TTY, SHOW_PROGRESS, TERM_WIDTH, + OUTPUT_DIR, + HTML_INDEX_FILENAME, ) @@ -221,8 +222,8 @@ def log_archiving_paused(num_links: int, idx: int, timestamp: str): total=num_links, )) print() - print(' To view your archive, open:') - print(' {}/index.html'.format(OUTPUT_DIR)) + print(' {lightred}Hint:{reset} To view your archive index, open:'.format(**ANSI)) + print(' {}/{}'.format(OUTPUT_DIR, HTML_INDEX_FILENAME)) print(' Continue archiving where you left off by running:') print(' archivebox update --resume={}'.format(timestamp)) @@ -248,8 +249,8 @@ def log_archiving_finished(num_links: int): print(' - {} links updated'.format(_LAST_RUN_STATS.succeeded)) print(' - {} links had errors'.format(_LAST_RUN_STATS.failed)) print() - print(' To view your archive, open:') - print(' {}/index.html'.format(OUTPUT_DIR)) + print(' {lightred}Hint:{reset} To view your archive index, open:'.format(**ANSI)) + print(' {}/{}'.format(OUTPUT_DIR, HTML_INDEX_FILENAME)) print(' Or run the built-in webserver:') print(' archivebox server') diff --git a/archivebox/main.py b/archivebox/main.py index 0949b6e5..7c824527 100644 --- a/archivebox/main.py +++ b/archivebox/main.py @@ -377,7 +377,7 @@ def init(force: bool=False, out_dir: str=OUTPUT_DIR) -> None: else: print('{green}[√] Done. A new ArchiveBox collection was initialized ({} links).{reset}'.format(len(all_links), **ANSI)) print() - print(' To view your archive index, open:') + print(' {lightred}Hint:{reset}To view your archive index, open:'.format(**ANSI)) print(' {}'.format(os.path.join(out_dir, HTML_INDEX_FILENAME))) print() print(' To add new links, you can run:')