From 60e4eeebb988abdeb4ae04b42b870ee0afbbcd67 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 27 Jun 2024 13:57:15 +0200 Subject: [PATCH] py --- spcd/__init__.py | 28 ++++++++++++++-------------- spcd/__main__.py | 4 ++-- spcd/cmd.py | 12 ++++++------ spcd/project.py | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/spcd/__init__.py b/spcd/__init__.py index a025f92..3a7c546 100644 --- a/spcd/__init__.py +++ b/spcd/__init__.py @@ -10,12 +10,12 @@ import env from rwx import fs from rwx.log import stream as log -import pidd -from pidd import cmd -from pidd.project import Project -from pidd.projects import Projects +import spcd +from spcd import cmd +from spcd.project import Project +from spcd.projects import Projects -COMMANDS_PREFIX = "pidd-" +COMMANDS_PREFIX = "spcd-" projects = Projects() project = Project(projects) @@ -58,8 +58,8 @@ def main(main: str) -> None: path, *arguments = sys.argv name = Path(path).name if name == "__main__.py": - pidd.set_ssh(*arguments) - pidd.install_commands(main) + spcd.set_ssh(*arguments) + spcd.install_commands(main) else: function = getattr(cmd, name.replace("-", "_")) function(*arguments) @@ -93,19 +93,19 @@ def set_ssh(*arguments: list[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: - log.info(f"{env.PIDD_SHUT}{text}") + log.info(f"{env.SPCD_SHUT}{text}") def split() -> None: - log.info(env.PIDD_SPLT) + log.info(env.SPCD_SPLT) def step(text: str) -> None: - env.PIDD_STEP += 1 - log.info(env.PIDD_DOWN) - log.info(f"{env.PIDD_VERT} {env.PIDD_STEP} {text}") - log.info(env.PIDD___UP) + env.SPCD_STEP += 1 + log.info(env.SPCD_DOWN) + log.info(f"{env.SPCD_VERT} {env.SPCD_STEP} {text}") + log.info(env.SPCD___UP) diff --git a/spcd/__main__.py b/spcd/__main__.py index db32c33..424985f 100755 --- a/spcd/__main__.py +++ b/spcd/__main__.py @@ -2,7 +2,7 @@ """Entry point.""" -import pidd +import spcd if __name__ == "__main__": - pidd.main(__file__) + spcd.main(__file__) diff --git a/spcd/cmd.py b/spcd/cmd.py index a2ea668..6c55eb2 100644 --- a/spcd/cmd.py +++ b/spcd/cmd.py @@ -4,14 +4,14 @@ from pathlib import Path from rwx import ps, split 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) -def pidd_build_project() -> None: +def spcd_build_project() -> None: for extension in ["py", "sh"]: path = Path(project.root) / f"build.{extension}" if path.exists(): @@ -21,7 +21,7 @@ def pidd_build_project() -> None: pass -def pidd_clone_branch() -> None: +def spcd_clone_branch() -> None: log.info(projects) split() 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()): log.info(f"{variable} = {value}") -def pidd_synchronize() -> None: +def spcd_synchronize() -> None: host = "rwx.work" source = "out" user = "cd" diff --git a/spcd/project.py b/spcd/project.py index 2bff2d8..7017d66 100644 --- a/spcd/project.py +++ b/spcd/project.py @@ -7,7 +7,7 @@ from typing import TYPE_CHECKING from urllib.parse import urljoin if TYPE_CHECKING: - from pidd.projects import Projects + from spcd.projects import Projects BRANCH = [ "GITHUB_REF_NAME",