py
This commit is contained in:
parent
0052a11203
commit
60e4eeebb9
4 changed files with 23 additions and 23 deletions
|
@ -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)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
"""Entry point."""
|
||||
|
||||
import pidd
|
||||
import spcd
|
||||
|
||||
if __name__ == "__main__":
|
||||
pidd.main(__file__)
|
||||
spcd.main(__file__)
|
||||
|
|
12
spcd/cmd.py
12
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"
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue