mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 22:54:27 -04:00
show python implementation name and flip verison output order for easier reading when wrapped on small screens
This commit is contained in:
parent
6623497f18
commit
30f8d3f191
2 changed files with 19 additions and 11 deletions
|
@ -19,6 +19,7 @@ if TYPE_CHECKING:
|
||||||
from .util import enforce_types
|
from .util import enforce_types
|
||||||
from .config import (
|
from .config import (
|
||||||
ConfigDict,
|
ConfigDict,
|
||||||
|
OUTPUT_DIR,
|
||||||
PYTHON_ENCODING,
|
PYTHON_ENCODING,
|
||||||
ANSI,
|
ANSI,
|
||||||
IS_TTY,
|
IS_TTY,
|
||||||
|
@ -514,19 +515,24 @@ def printable_folder_status(name: str, folder: Dict) -> str:
|
||||||
else:
|
else:
|
||||||
num_files = 'missing'
|
num_files = 'missing'
|
||||||
|
|
||||||
if ' ' in str(folder['path']):
|
path = str(folder['path']).replace(str(OUTPUT_DIR), '.') if folder['path'] else ''
|
||||||
folder['path'] = f'"{folder["path"]}"'
|
if path and ' ' in path:
|
||||||
|
path = f'"{path}"'
|
||||||
|
|
||||||
|
# if path is just a plain dot, replace it back with the full path for clarity
|
||||||
|
if path == '.':
|
||||||
|
path = str(OUTPUT_DIR)
|
||||||
|
|
||||||
return ' '.join((
|
return ' '.join((
|
||||||
ANSI[color],
|
ANSI[color],
|
||||||
symbol,
|
symbol,
|
||||||
ANSI['reset'],
|
ANSI['reset'],
|
||||||
name.ljust(22),
|
name.ljust(21),
|
||||||
(str(folder["path"]) or '').ljust(76),
|
|
||||||
num_files.ljust(14),
|
num_files.ljust(14),
|
||||||
ANSI[color],
|
ANSI[color],
|
||||||
note,
|
note.ljust(8),
|
||||||
ANSI['reset'],
|
ANSI['reset'],
|
||||||
|
path.ljust(76),
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
|
@ -546,17 +552,18 @@ def printable_dependency_version(name: str, dependency: Dict) -> str:
|
||||||
else:
|
else:
|
||||||
color, symbol, note, version = 'lightyellow', '-', 'disabled', '-'
|
color, symbol, note, version = 'lightyellow', '-', 'disabled', '-'
|
||||||
|
|
||||||
if ' ' in (dependency["path"] or ''):
|
path = str(dependency["path"]).replace(str(OUTPUT_DIR), '.') if dependency["path"] else ''
|
||||||
dependency["path"] = f'"{dependency["path"]}"'
|
if path and ' ' in path:
|
||||||
|
path = f'"{path}"'
|
||||||
|
|
||||||
return ' '.join((
|
return ' '.join((
|
||||||
ANSI[color],
|
ANSI[color],
|
||||||
symbol,
|
symbol,
|
||||||
ANSI['reset'],
|
ANSI['reset'],
|
||||||
name.ljust(22),
|
name.ljust(21),
|
||||||
(dependency["path"] or '').ljust(76),
|
|
||||||
version.ljust(14),
|
version.ljust(14),
|
||||||
ANSI[color],
|
ANSI[color],
|
||||||
note,
|
note.ljust(8),
|
||||||
ANSI['reset'],
|
ANSI['reset'],
|
||||||
|
path.ljust(76),
|
||||||
))
|
))
|
||||||
|
|
|
@ -69,6 +69,7 @@ from .config import (
|
||||||
ANSI,
|
ANSI,
|
||||||
IS_TTY,
|
IS_TTY,
|
||||||
IN_DOCKER,
|
IN_DOCKER,
|
||||||
|
PYTHON_VERSION,
|
||||||
USER,
|
USER,
|
||||||
ARCHIVEBOX_BINARY,
|
ARCHIVEBOX_BINARY,
|
||||||
ONLY_NEW,
|
ONLY_NEW,
|
||||||
|
@ -218,7 +219,7 @@ def version(quiet: bool=False,
|
||||||
else:
|
else:
|
||||||
print('ArchiveBox v{}'.format(VERSION))
|
print('ArchiveBox v{}'.format(VERSION))
|
||||||
p = platform.uname()
|
p = platform.uname()
|
||||||
print(p.system, platform.platform(), p.machine)
|
print(sys.implementation.name.title(), p.system, platform.platform(), p.machine, f'(in Docker)' if IN_DOCKER else f'(not in Docker)')
|
||||||
print()
|
print()
|
||||||
|
|
||||||
print('{white}[i] Dependency versions:{reset}'.format(**ANSI))
|
print('{white}[i] Dependency versions:{reset}'.format(**ANSI))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue