mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 22:54:27 -04:00
tweak cli output coloring
This commit is contained in:
parent
d7d53cfb12
commit
2557a0da04
1 changed files with 4 additions and 5 deletions
|
@ -162,12 +162,10 @@ def progress_bar(seconds: int, prefix: str='') -> None:
|
||||||
def log_cli_command(subcommand: str, subcommand_args: List[str], stdin: Optional[str], pwd: str):
|
def log_cli_command(subcommand: str, subcommand_args: List[str], stdin: Optional[str], pwd: str):
|
||||||
from .config import VERSION, ANSI
|
from .config import VERSION, ANSI
|
||||||
cmd = ' '.join(('archivebox', subcommand, *subcommand_args))
|
cmd = ' '.join(('archivebox', subcommand, *subcommand_args))
|
||||||
stdin_hint = ' < /dev/stdin' if not stdin.isatty() else ''
|
stderr('{black}[i] [{now}] ArchiveBox v{VERSION}: {cmd}{reset}'.format(
|
||||||
stderr('{black}[i] [{now}] ArchiveBox v{VERSION}: {cmd}{stdin_hint}{reset}'.format(
|
|
||||||
now=datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
|
now=datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
|
||||||
VERSION=VERSION,
|
VERSION=VERSION,
|
||||||
cmd=cmd,
|
cmd=cmd,
|
||||||
stdin_hint=stdin_hint,
|
|
||||||
**ANSI,
|
**ANSI,
|
||||||
))
|
))
|
||||||
stderr('{black} > {pwd}{reset}'.format(pwd=pwd, **ANSI))
|
stderr('{black} > {pwd}{reset}'.format(pwd=pwd, **ANSI))
|
||||||
|
@ -198,7 +196,8 @@ def log_deduping_finished(num_new_links: int):
|
||||||
|
|
||||||
|
|
||||||
def log_crawl_started(new_links):
|
def log_crawl_started(new_links):
|
||||||
print('{lightred}[*] Starting crawl of {} sites 1 hop out from starting point{reset}'.format(len(new_links), **ANSI))
|
print()
|
||||||
|
print('{green}[*] Starting crawl of {} sites 1 hop out from starting point{reset}'.format(len(new_links), **ANSI))
|
||||||
|
|
||||||
### Indexing Stage
|
### Indexing Stage
|
||||||
|
|
||||||
|
@ -347,7 +346,7 @@ def log_archive_method_finished(result: "ArchiveResult"):
|
||||||
|
|
||||||
# Collect and prefix output lines with indentation
|
# Collect and prefix output lines with indentation
|
||||||
output_lines = [
|
output_lines = [
|
||||||
'{lightred}Failed:{reset}'.format(**ANSI),
|
'{lightyellow}Extractor failed:{reset}'.format(**ANSI),
|
||||||
' {reset}{} {red}{}{reset}'.format(
|
' {reset}{} {red}{}{reset}'.format(
|
||||||
result.output.__class__.__name__.replace('ArchiveError', ''),
|
result.output.__class__.__name__.replace('ArchiveError', ''),
|
||||||
result.output,
|
result.output,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue