From 936c15786532bd945914b724430cdd6cb3668e68 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 13 Jun 2024 13:44:59 +0200 Subject: [PATCH] log.info --- cd/__init__.py | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index 227e54d..7c86330 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -31,11 +31,11 @@ def cd_build_project() -> None: def cd_clone_branch() -> None: - print(projects, end="") + log.info(projects) split() - print(project, end="") + log.info(project) split() - print( + log.info( f"""\ {project.url} ↓ @@ -56,7 +56,7 @@ def cd_clone_branch() -> None: def cd_list_environment() -> None: for variable, value in sorted(projects.environment.items()): - print(variable, "=", value) + log.info(f"{variable} = {value}") def cd_synchronize() -> None: @@ -87,13 +87,13 @@ def browse(root: str) -> None: paths.append(relative_path) frame(root) for path in sorted(paths): - print(path) + log.info(path) shut(root) def cat(file: str) -> None: frame(file) - print(fs.read_file_text(file).rstrip()) + log.info(fs.read_file_text(file).rstrip()) shut(file) @@ -107,7 +107,7 @@ def install_commands(path: str) -> None: "list-environment", "synchronize", ]: - print(command) + log.info(command) (user / f"{COMMANDS_PREFIX}{command}").symlink_to(path) @@ -138,22 +138,20 @@ def set_ssh(*arguments: str) -> None: cat(known) -def frame(*arguments: str) -> None: - print(env.CD_OPEN, end="") - print(*arguments, flush=True) +def frame(text: str) -> None: + log.info(f"{env.CD_OPEN}{text}") -def shut(*arguments: str) -> None: - print(env.CD_SHUT, end="") - print(*arguments, flush=True) +def shut(text: str) -> None: + log.info(f"{env.CD_SHUT}{text}") def split() -> None: - print(env.CD_SPLT, flush=True) + log.info(env.CD_SPLT) -def step(*arguments: str) -> None: +def step(text: str) -> None: env.CD_STEP += 1 log.info(env.CD_DOWN) - print(env.CD_VERT, env.CD_STEP, *arguments) + log.info(f"{env.CD_VERT} {env.CD_STEP} {text}") log.info(env.CD___UP)