From 27a9b419d9595164966a665043a4f38ee658dc30 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 12:45:54 +0200 Subject: [PATCH] open,shut --- cd.sh | 24 ++++++++---------------- cd/__init__.py | 20 +++++++++++++++----- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/cd.sh b/cd.sh index 4781d48..e0bbb65 100644 --- a/cd.sh +++ b/cd.sh @@ -575,23 +575,15 @@ cd_write_python_module () { cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ STEP = ${CD_STEP} + +$(cd_echo CD_DOWN CD_VERTICAL CD_UP) + +$(cd_echo CD_OPEN CD_SHUT) + +$(cd_echo CD_SPLIT) + + $(cd_echo CD_OS_ID CD_OS_VERSION) - -DOWN = \"${CD_DOWN}\" -VERTICAL = \"${CD_VERTICAL}\" -UP = \"${CD_UP}\" - -SPLIT = \"${CD_SPLIT}\" - - -def open(*arguments): - print('${CD_OPEN}', end=str()) - print(*arguments, flush=True) - - -def shut(*arguments): - print('${CD_SHUT}', end=str()) - print(*arguments, flush=True) " } diff --git a/cd/__init__.py b/cd/__init__.py index 968ad16..6bb0000 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -110,12 +110,22 @@ def set_ssh(*arguments): os.chmod(known, 0o400) +def open(*arguments): + print(env.CD_OPEN, end=str()) + print(*arguments, flush=True) + + +def shut(*arguments): + print(env.CD_SHUT, end=str()) + print(*arguments, flush=True) + + def split(): - print(env.SPLIT, flush=True) + print(env.CD_SPLIT, flush=True) def step(*arguments): - env.STEP += 1 - print(env.DOWN) - print(env.VERTICAL, env.STEP, *arguments) - print(env.UP, flush=True) + env.CD_STEP += 1 + print(env.CD_DOWN) + print(env.CD_VERTICAL, env.CD_STEP, *arguments) + print(env.CD_UP, flush=True)