This commit is contained in:
Marc Beninca 2024-06-27 13:57:15 +02:00
parent 0052a11203
commit 60e4eeebb9
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
4 changed files with 23 additions and 23 deletions

View file

@ -10,12 +10,12 @@ import env
from rwx import fs from rwx import fs
from rwx.log import stream as log from rwx.log import stream as log
import pidd import spcd
from pidd import cmd from spcd import cmd
from pidd.project import Project from spcd.project import Project
from pidd.projects import Projects from spcd.projects import Projects
COMMANDS_PREFIX = "pidd-" COMMANDS_PREFIX = "spcd-"
projects = Projects() projects = Projects()
project = Project(projects) project = Project(projects)
@ -58,8 +58,8 @@ def main(main: str) -> None:
path, *arguments = sys.argv path, *arguments = sys.argv
name = Path(path).name name = Path(path).name
if name == "__main__.py": if name == "__main__.py":
pidd.set_ssh(*arguments) spcd.set_ssh(*arguments)
pidd.install_commands(main) spcd.install_commands(main)
else: else:
function = getattr(cmd, name.replace("-", "_")) function = getattr(cmd, name.replace("-", "_"))
function(*arguments) function(*arguments)
@ -93,19 +93,19 @@ def set_ssh(*arguments: list[str]) -> None:
def frame(text: str) -> None: def frame(text: str) -> None:
log.info(f"{env.PIDD_OPEN}{text}") log.info(f"{env.SPCD_OPEN}{text}")
def shut(text: str) -> None: def shut(text: str) -> None:
log.info(f"{env.PIDD_SHUT}{text}") log.info(f"{env.SPCD_SHUT}{text}")
def split() -> None: def split() -> None:
log.info(env.PIDD_SPLT) log.info(env.SPCD_SPLT)
def step(text: str) -> None: def step(text: str) -> None:
env.PIDD_STEP += 1 env.SPCD_STEP += 1
log.info(env.PIDD_DOWN) log.info(env.SPCD_DOWN)
log.info(f"{env.PIDD_VERT} {env.PIDD_STEP} {text}") log.info(f"{env.SPCD_VERT} {env.SPCD_STEP} {text}")
log.info(env.PIDD___UP) log.info(env.SPCD___UP)

View file

@ -2,7 +2,7 @@
"""Entry point.""" """Entry point."""
import pidd import spcd
if __name__ == "__main__": if __name__ == "__main__":
pidd.main(__file__) spcd.main(__file__)

View file

@ -4,14 +4,14 @@ from pathlib import Path
from rwx import ps, split from rwx import ps, split
from rwx.log import log from rwx.log import log
from pidd import browse, project, projects from spcd import browse, project, projects
def pidd_browse_workspace() -> None: def spcd_browse_workspace() -> None:
browse(project.root) browse(project.root)
def pidd_build_project() -> None: def spcd_build_project() -> None:
for extension in ["py", "sh"]: for extension in ["py", "sh"]:
path = Path(project.root) / f"build.{extension}" path = Path(project.root) / f"build.{extension}"
if path.exists(): if path.exists():
@ -21,7 +21,7 @@ def pidd_build_project() -> None:
pass pass
def pidd_clone_branch() -> None: def spcd_clone_branch() -> None:
log.info(projects) log.info(projects)
split() split()
log.info(project) log.info(project)
@ -41,12 +41,12 @@ def pidd_clone_branch() -> None:
) )
def pidd_list_environment() -> None: def spcd_list_environment() -> None:
for variable, value in sorted(projects.environment.items()): for variable, value in sorted(projects.environment.items()):
log.info(f"{variable} = {value}") log.info(f"{variable} = {value}")
def pidd_synchronize() -> None: def spcd_synchronize() -> None:
host = "rwx.work" host = "rwx.work"
source = "out" source = "out"
user = "cd" user = "cd"

View file

@ -7,7 +7,7 @@ from typing import TYPE_CHECKING
from urllib.parse import urljoin from urllib.parse import urljoin
if TYPE_CHECKING: if TYPE_CHECKING:
from pidd.projects import Projects from spcd.projects import Projects
BRANCH = [ BRANCH = [
"GITHUB_REF_NAME", "GITHUB_REF_NAME",