From 0b8bdd8cc53758c2525c222b00b9217e9c8bf7ad Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 16 Feb 2021 15:53:52 -0500 Subject: [PATCH] show dir size after each snapshot archiving process in cli --- archivebox/logging_util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/archivebox/logging_util.py b/archivebox/logging_util.py index 0a41fe5f..d07ec6e4 100644 --- a/archivebox/logging_util.py +++ b/archivebox/logging_util.py @@ -17,6 +17,7 @@ from typing import Any, Optional, List, Dict, Union, IO, TYPE_CHECKING if TYPE_CHECKING: from .index.schema import Link, ArchiveResult +from .system import get_dir_size from .util import enforce_types from .config import ( ConfigDict, @@ -318,8 +319,6 @@ def log_archiving_paused(num_links: int, idx: int, timestamp: str): total=num_links, )) print() - print(' {lightred}Hint:{reset} To view your archive index, run:'.format(**ANSI)) - print(' archivebox server # then visit http://127.0.0.1:8000') print(' Continue archiving where you left off by running:') print(' archivebox update --resume={}'.format(timestamp)) @@ -377,6 +376,9 @@ def log_link_archiving_finished(link: "Link", link_dir: str, is_new: bool, stats else: _LAST_RUN_STATS.succeeded += 1 + size = get_dir_size(link_dir) + print(' {black}{} files ({}){reset}'.format(size[2], printable_filesize(size[0]), **ANSI)) + def log_archive_method_started(method: str): print(' > {}'.format(method))