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 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)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
"""Entry point."""
|
"""Entry point."""
|
||||||
|
|
||||||
import pidd
|
import spcd
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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 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"
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue