From 6aedbd3c7c896fbd14c96f1042e5732add22e94f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 21 Jun 2024 13:07:44 +0200 Subject: [PATCH] .py --- cidd/__init__.py | 40 ++++++++++++++++++++-------------------- cidd/__main__.py | 4 ++-- cidd/project.py | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cidd/__init__.py b/cidd/__init__.py index 9d776e7..b735c80 100644 --- a/cidd/__init__.py +++ b/cidd/__init__.py @@ -1,4 +1,4 @@ -"""Continuous Deployment.""" +"""Continuous Integration, Delivery & Deployment.""" __version__ = "0.0.1" @@ -10,21 +10,21 @@ import env from rwx import fs, ps from rwx.log import stream as log -import cd -from cd.project import Project -from cd.projects import Projects +import cidd +from cidd.project import Project +from cidd.projects import Projects -COMMANDS_PREFIX = "cd-" +COMMANDS_PREFIX = "cidd-" projects = Projects() project = Project(projects) -def cd_browse_workspace() -> None: +def cidd_browse_workspace() -> None: browse(project.root) -def cd_build_project() -> None: +def cidd_build_project() -> None: for extension in ["py", "sh"]: path = Path(project.root) / f"build.{extension}" if path.exists(): @@ -34,7 +34,7 @@ def cd_build_project() -> None: pass -def cd_clone_branch() -> None: +def cidd_clone_branch() -> None: log.info(projects) split() log.info(project) @@ -58,12 +58,12 @@ def cd_clone_branch() -> None: ) -def cd_list_environment() -> None: +def cidd_list_environment() -> None: for variable, value in sorted(projects.environment.items()): log.info(f"{variable} = {value}") -def cd_synchronize() -> None: +def cidd_synchronize() -> None: host = "rwx.work" source = "out" user = "cd" @@ -119,10 +119,10 @@ def main() -> None: path, *arguments = sys.argv name = Path(path).name if name == "__main__.py": - cd.set_ssh(*arguments) - cd.install_commands(__file__) + cidd.set_ssh(*arguments) + cidd.install_commands(__file__) else: - function = getattr(cd, name.replace("-", "_")) + function = getattr(cidd, name.replace("-", "_")) function(*arguments) @@ -154,19 +154,19 @@ def set_ssh(*arguments: str) -> None: def frame(text: str) -> None: - log.info(f"{env.CD_OPEN}{text}") + log.info(f"{env.CIDD_OPEN}{text}") def shut(text: str) -> None: - log.info(f"{env.CD_SHUT}{text}") + log.info(f"{env.CIDD_SHUT}{text}") def split() -> None: - log.info(env.CD_SPLT) + log.info(env.CIDD_SPLT) def step(text: str) -> None: - env.CD_STEP += 1 - log.info(env.CD_DOWN) - log.info(f"{env.CD_VERT} {env.CD_STEP} {text}") - log.info(env.CD___UP) + env.CIDD_STEP += 1 + log.info(env.CIDD_DOWN) + log.info(f"{env.CIDD_VERT} {env.CIDD_STEP} {text}") + log.info(env.CIDD___UP) diff --git a/cidd/__main__.py b/cidd/__main__.py index 1ec83d5..2d29cea 100755 --- a/cidd/__main__.py +++ b/cidd/__main__.py @@ -2,7 +2,7 @@ """Entry point.""" -import cd +import cidd if __name__ == "__main__": - cd.main(__file__) + cidd.main(__file__) diff --git a/cidd/project.py b/cidd/project.py index d1244d9..787c97c 100644 --- a/cidd/project.py +++ b/cidd/project.py @@ -7,7 +7,7 @@ from typing import TYPE_CHECKING from urllib.parse import urljoin if TYPE_CHECKING: - from cd.projects import Projects + from cidd.projects import Projects BRANCH = [ "GITHUB_REF_NAME",