Compare commits

..

8 commits

Author SHA1 Message Date
b3f4cffbca
−str
Some checks failed
/ arch (push) Successful in 1m22s
/ alpine (push) Successful in 44s
/ fedora (push) Successful in 7m37s
/ opensuse (push) Successful in 2m34s
/ alma (push) Successful in 2m28s
/ rocky (push) Successful in 7m1s
/ ubuntu (push) Successful in 1m14s
/ debian (push) Failing after 58s
2024-09-16 21:47:53 +02:00
4cab5f3894
−repr 2024-09-16 21:29:25 +02:00
f0aa902904
doc/projects
Some checks failed
/ arch (push) Successful in 1m39s
/ alpine (push) Successful in 42s
/ fedora (push) Successful in 11m26s
/ opensuse (push) Successful in 2m19s
/ alma (push) Successful in 2m31s
/ rocky (push) Successful in 3m57s
/ ubuntu (push) Successful in 1m26s
/ debian (push) Failing after 1m3s
2024-09-16 01:40:27 +02:00
0d1ad96295
doc/quiet 2024-09-16 01:18:03 +02:00
ac72fb1331
doc/add_url_path 2024-09-16 01:14:52 +02:00
7251ca35fa
format 2024-09-16 01:13:18 +02:00
40bb13c39a
doc/browse,cat 2024-09-16 01:08:25 +02:00
ba8c9baa54
doc/frame,shut,step 2024-09-16 01:03:41 +02:00
5 changed files with 40 additions and 33 deletions

View file

@ -33,6 +33,7 @@ path = "spcd/__init__.py"
[tool.pydoclint]
allow-init-docstring = true
quiet = true
skip-checking-short-docstrings = false
style = "sphinx"

View file

@ -26,10 +26,13 @@ def clone_project_branch() -> None:
split()
log.info(project)
split()
log.info("""\
log.info(
"""\
%s
""", project.url)
""",
project.url,
)
run(
"git",
"clone",

View file

@ -44,16 +44,3 @@ class Project:
self.root = Path(value)
# url
self.url = add_url_path(projects.url, self.name)
def __repr__(self) -> str:
"""Represent project."""
return f"Project(projects={self.projects!r})"
def __str__(self) -> str:
"""List branch, name, root & url."""
return f"""\
branch = {self.branch}
name = {self.name}
root = {self.root}
url = {self.url}
"""

View file

@ -33,15 +33,3 @@ class Projects:
for variable in SERVER_URL:
if value := self.environment.get(variable, None):
self.url = add_url_path(value, self.group)
def __repr__(self) -> str:
"""Represent projects."""
return "Projects()"
def __str__(self) -> str:
"""List group, name & url."""
return f"""\
group = {self.group}
name = {self.name}
url = {self.url}
"""

View file

@ -12,14 +12,26 @@ from spcd.shell import env
def add_url_path(url: str, extra_path: str) -> str:
"""Append an extra segment to an existing URL."""
"""Append an extra segment to an existing URL.
:param url: base URL
:type url: str
:param extra_path: path to append
:type extra_path: str
:return: new URL
:rtype: str
"""
parts = urlparse(url)
parts = parts._replace(path=str(Path(parts.path) / extra_path))
return urlunparse(parts)
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 = []
for directory, _, files in os.walk(root):
for file in files:
@ -34,7 +46,11 @@ def browse(root: 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)
frame(text)
log.info(fs.read_file_text(file).rstrip())
@ -42,12 +58,20 @@ def cat(file: Path) -> None:
def frame(text: str) -> None:
"""Open a new frame in the log output."""
"""Open a new frame in the log output.
:param text: text to start the frame with
:type text: str
"""
log.info("%s%s", env.SPCD_OPEN, text)
def shut(text: str) -> None:
"""Close current frame in the log output."""
"""Close current frame in the log output.
:param text: text to shut the frame with
:type text: str
"""
log.info("%s%s", env.SPCD_SHUT, text)
@ -57,7 +81,11 @@ def split() -> None:
def step(text: str) -> None:
"""Increment the step number of the current build process."""
"""Increment the step number of the current build process.
:param text: text to display
:type text: str
"""
shell.STEP += 1
log.info(env.SPCD_DOWN)
log.info("%s %s %s", env.SPCD_VERT, shell.STEP, text)