doc/browse,cat

This commit is contained in:
Marc Beninca 2024-09-16 01:08:25 +02:00
parent ba8c9baa54
commit 40bb13c39a
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -19,7 +19,11 @@ def add_url_path(url: str, extra_path: str) -> str:
def browse(root: Path) -> None: def browse(root: Path) -> None:
"""Frame the browsing of a root directory in the log output.""" """Frame the browsing of a root directory in the log output.
:param root: directory to browse
:type root: Path
"""
paths = [] paths = []
for directory, _, files in os.walk(root): for directory, _, files in os.walk(root):
for file in files: for file in files:
@ -34,7 +38,11 @@ def browse(root: Path) -> None:
def cat(file: Path) -> None: def cat(file: Path) -> None:
"""Frame the content of a file in the log output.""" """Frame the content of a file in the log output.
:param file: file to read the content from
:type file: Path
"""
text = str(file) text = str(file)
frame(text) frame(text)
log.info(fs.read_file_text(file).rstrip()) log.info(fs.read_file_text(file).rstrip())