diff --git a/archivebox/cli/logging.py b/archivebox/cli/logging.py index 53a65664..6de78d8f 100644 --- a/archivebox/cli/logging.py +++ b/archivebox/cli/logging.py @@ -24,6 +24,7 @@ from ..config import ( TERM_WIDTH, OUTPUT_DIR, HTML_INDEX_FILENAME, + stderr, ) @@ -160,6 +161,7 @@ def log_parsing_started(source_file: str): **ANSI, )) + def log_parsing_finished(num_parsed: int, num_new_links: int, parser_name: str): end_ts = datetime.now() _LAST_RUN_STATS.parse_end_ts = end_ts @@ -178,14 +180,17 @@ def log_indexing_process_started(num_links: int): **ANSI, )) + def log_indexing_process_finished(): end_ts = datetime.now() _LAST_RUN_STATS.index_end_ts = end_ts + def log_indexing_started(out_path: str): if IS_TTY: sys.stdout.write(f' > {out_path}') + def log_indexing_finished(out_path: str): print(f'\r √ {out_path}') diff --git a/archivebox/core/models.py b/archivebox/core/models.py index 2c0c9e37..f3c03119 100644 --- a/archivebox/core/models.py +++ b/archivebox/core/models.py @@ -25,10 +25,12 @@ class Snapshot(models.Model): def __repr__(self) -> str: - return f'[{self.timestamp}] {self.url[:64]} ({self.title[:64]})' + title = self.title or '-' + return f'[{self.timestamp}] {self.url[:64]} ({title[:64]})' def __str__(self) -> str: - return f'[{self.timestamp}] {self.url[:64]} ({self.title[:64]})' + title = self.title or '-' + return f'[{self.timestamp}] {self.url[:64]} ({title[:64]})' @classmethod def from_json(cls, info: dict): diff --git a/archivebox/extractors/wget.py b/archivebox/extractors/wget.py index 2e0957e0..503c3bad 100644 --- a/archivebox/extractors/wget.py +++ b/archivebox/extractors/wget.py @@ -7,7 +7,7 @@ from typing import Optional from datetime import datetime from ..index.schema import Link, ArchiveResult, ArchiveOutput, ArchiveError -from ..system import run +from ..system import run, chmod_file from ..util import ( enforce_types, is_static_file,