doc/browse,cat
This commit is contained in:
parent
ba8c9baa54
commit
40bb13c39a
1 changed files with 10 additions and 2 deletions
12
spcd/util.py
12
spcd/util.py
|
@ -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())
|
||||||
|
|
Loading…
Reference in a new issue