From 0702d13263bf501c1db074ce1544e60b95161210 Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Sun, 7 Nov 2021 15:52:44 +0100 Subject: major rewrite --- playground/.gitignore | 3 +++ playground/build.sh | 6 ++++++ playground/calculate.sh | 8 ++++++++ playground/calculate/.gitignore | 3 --- playground/calculate/params.yaml | 12 ------------ playground/calculate/run.sh | 10 ---------- playground/env.sh | 7 +++++++ playground/generate_output.sh | 9 +++++++++ playground/params.yaml | 12 ++++++++++++ playground/server.sh | 6 ++++++ playground/server/run.sh | 7 ------- 11 files changed, 51 insertions(+), 32 deletions(-) create mode 100644 playground/.gitignore create mode 100755 playground/build.sh create mode 100755 playground/calculate.sh delete mode 100644 playground/calculate/.gitignore delete mode 100644 playground/calculate/params.yaml delete mode 100755 playground/calculate/run.sh create mode 100644 playground/env.sh create mode 100755 playground/generate_output.sh create mode 100644 playground/params.yaml create mode 100755 playground/server.sh delete mode 100755 playground/server/run.sh (limited to 'playground') diff --git a/playground/.gitignore b/playground/.gitignore new file mode 100644 index 0000000..70dafff --- /dev/null +++ b/playground/.gitignore @@ -0,0 +1,3 @@ +/result.yaml +/output.pdf +/output.svg diff --git a/playground/build.sh b/playground/build.sh new file mode 100755 index 0000000..e927d5f --- /dev/null +++ b/playground/build.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +. $(dirname -- "$0")/env.sh + +cd $ROOT_PATH +exec $PYTHON -m doit diff --git a/playground/calculate.sh b/playground/calculate.sh new file mode 100755 index 0000000..2db0ada --- /dev/null +++ b/playground/calculate.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +. $(dirname -- "$0")/env.sh + +exec $PYTHON -m opcut calculate \ + --params $RUN_PATH/params.yaml \ + --result $RUN_PATH/result.yaml \ + "$@" diff --git a/playground/calculate/.gitignore b/playground/calculate/.gitignore deleted file mode 100644 index 70dafff..0000000 --- a/playground/calculate/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/result.yaml -/output.pdf -/output.svg diff --git a/playground/calculate/params.yaml b/playground/calculate/params.yaml deleted file mode 100644 index 605acec..0000000 --- a/playground/calculate/params.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -cut_width: 1 -panels: - p1: - width: 50 - height: 50 -items: - i1: - width: 5 - height: 5 - can_rotate: true -... diff --git a/playground/calculate/run.sh b/playground/calculate/run.sh deleted file mode 100755 index b1670e3..0000000 --- a/playground/calculate/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -PYTHONPATH=../../src_py python -m opcut \ - --json-schemas-path ../../schemas_json \ - --ui-path ../../build/js \ - calculate \ - --params params.yaml \ - --result result.yaml \ - --output output.pdf \ - $* diff --git a/playground/env.sh b/playground/env.sh new file mode 100644 index 0000000..b39dc8b --- /dev/null +++ b/playground/env.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +PYTHON=${PYTHON:-python} +RUN_PATH=$(cd $(dirname -- "$0") && pwd) +ROOT_PATH=$RUN_PATH/.. + +export PYTHONPATH=$ROOT_PATH/src_py diff --git a/playground/generate_output.sh b/playground/generate_output.sh new file mode 100755 index 0000000..1eaae94 --- /dev/null +++ b/playground/generate_output.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +. $(dirname -- "$0")/env.sh + +exec $PYTHON -m opcut generate_output \ + --output-type pdf \ + --result $RUN_PATH/result.yaml \ + --output $RUN_PATH/output.pdf \ + "$@" diff --git a/playground/params.yaml b/playground/params.yaml new file mode 100644 index 0000000..605acec --- /dev/null +++ b/playground/params.yaml @@ -0,0 +1,12 @@ +--- +cut_width: 1 +panels: + p1: + width: 50 + height: 50 +items: + i1: + width: 5 + height: 5 + can_rotate: true +... diff --git a/playground/server.sh b/playground/server.sh new file mode 100755 index 0000000..388bc25 --- /dev/null +++ b/playground/server.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +. $(dirname -- "$0")/env.sh + +exec $PYTHON -m opcut server \ + "$@" diff --git a/playground/server/run.sh b/playground/server/run.sh deleted file mode 100755 index 887442e..0000000 --- a/playground/server/run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -PYTHONPATH=../../src_py python -m opcut \ - --json-schemas-path ../../schemas_json \ - --ui-path ../../build/js \ - server \ - $* -- cgit v1.2.3-70-g09d2