diff --git a/cd.sh b/cd.sh index b64ce20..b88b6fd 100644 --- a/cd.sh +++ b/cd.sh @@ -573,9 +573,13 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ +STEP = ${CD_STEP} + $(cd_echo CD_OS_ID CD_OS_VERSION) -STEP = ${CD_STEP} +DOWN = \"${CD_DOWN}\" +UP = \"${CD_UP}\" +VERTICAL = \"${CD_BOX_VERTICAL}\" def open(*arguments): @@ -590,13 +594,6 @@ def shut(*arguments): def split(): print('${CD_SPLIT}', flush=True) - - -def step(*arguments): - STEP += 1 - print('${CD_DOWN}') - print('${CD_BOX_VERTICAL}', STEP, *arguments) - print('${CD_UP}', flush=True) " } diff --git a/cd/__init__.py b/cd/__init__.py index 279a18f..d1c1653 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -107,3 +107,10 @@ def set_ssh(*arguments): if ssh_hosts: fs.write(known, ssh_hosts) os.chmod(known, 0o400) + + +def step(*arguments): + env.STEP += 1 + print(env.DOWN) + print(env.VERTICAL, env.STEP, *arguments) + print(env.UP, flush=True)