archivebox.logging_util
Module Contents
Classes
mutable stats counter for logging archiving timing info to CLI output |
|
Patched formatter that prints newlines in argparse help strings |
|
Show a progress bar and measure elapsed time until .end() is called |
Functions
Tell the user they passed stdin to a command that doesn’t accept it |
|
accept any standard input and return it as a string or None |
|
show timer in the form of progress bar, with percentage and seconds remaining |
|
quote the argument with whitespace in a command so the user can copy-paste the outputted string directly to run the cmd |
|
convert paths like …/ArchiveBox/archivebox/../output/abc into output/abc |
|
Data
API
- class archivebox.logging_util.RuntimeStats[source]
mutable stats counter for logging archiving timing info to CLI output
- class archivebox.logging_util.SmartFormatter[source]
Bases:
django.core.management.base.DjangoHelpFormatter
,rich_argparse.RichHelpFormatter
Patched formatter that prints newlines in argparse help strings
- archivebox.logging_util.reject_stdin(caller: str, stdin: Optional[IO] = sys.stdin) None [source]
Tell the user they passed stdin to a command that doesn’t accept it
- archivebox.logging_util.accept_stdin(stdin: Optional[IO] = sys.stdin) Optional[str] [source]
accept any standard input and return it as a string or None
- class archivebox.logging_util.TimedProgress(seconds, prefix='')[source]
Show a progress bar and measure elapsed time until .end() is called
Initialization
- archivebox.logging_util.progress_bar(seconds: int, prefix: str = '', ANSI: Dict[str, str] = ANSI) None [source]
show timer in the form of progress bar, with percentage and seconds remaining
- archivebox.logging_util.log_cli_command(subcommand: str, subcommand_args: List[str], stdin: Optional[str | IO], pwd: str = '.')[source]
- archivebox.logging_util.log_importing_started(urls: Union[str, List[str]], depth: int, index_only: bool)[source]
- archivebox.logging_util.log_archiving_started(num_links: int, resume: Optional[float] = None)[source]
- archivebox.logging_util.log_link_archiving_started(link: archivebox.index.schema.Link, link_dir: str, is_new: bool)[source]
- archivebox.logging_util.log_link_archiving_finished(link: archivebox.index.schema.Link, link_dir: str, is_new: bool, stats: dict, start_ts: datetime.datetime)[source]
- archivebox.logging_util.log_archive_method_finished(result: archivebox.index.schema.ArchiveResult)[source]
quote the argument with whitespace in a command so the user can copy-paste the outputted string directly to run the cmd
- archivebox.logging_util.log_list_started(filter_patterns: Optional[List[str]], filter_type: str)[source]
- archivebox.logging_util.log_removal_started(links: List[archivebox.index.schema.Link], yes: bool, delete: bool)[source]
- archivebox.logging_util.pretty_path(path: Union[pathlib.Path, str], pwd: Union[pathlib.Path, str] = DATA_DIR, color: bool = True) str [source]
convert paths like …/ArchiveBox/archivebox/../output/abc into output/abc
- archivebox.logging_util.printable_folders(folders: Dict[str, Optional[archivebox.index.schema.Link]], with_headers: bool = False) str [source]