Align cut options with PT-P700 capabilities

This commit is contained in:
Mikei386
2026-06-22 11:56:27 +02:00
parent b26b9fe123
commit 941c68bbf8
9 changed files with 24 additions and 139 deletions
+2 -5
View File
@@ -23,7 +23,7 @@ import os
command = os.environ.get("PRINT_COMMAND", "ptouch-print --image {image}")
try:
command.format(image="/tmp/test.png", copies=1)
command.format(image="/tmp/test.png", copies=1, cut_args="")
except Exception as exc:
raise SystemExit(f"ERROR: invalid PRINT_COMMAND: {exc}")
PY
@@ -56,12 +56,9 @@ if ! python3 -c "import qrcode, barcode" >/dev/null 2>&1; then
python3 -m pip install --root-user-action=ignore --no-cache-dir qrcode python-barcode
fi
if ! command -v ptouch-print >/dev/null 2>&1 || ! ptouch-print --help 2>&1 | grep -q -- "--no-halfcut"; then
if ! command -v ptouch-print >/dev/null 2>&1; then
rm -rf "$PTOUCH_SRC_DIR"
git clone --depth 1 --branch farix-main https://github.com/farixembedded/ptouch-print.git "$PTOUCH_SRC_DIR"
if [ -f "$APP_DIR/patches/ptouch-print-cut-options.patch" ]; then
patch -d "$PTOUCH_SRC_DIR" -p1 < "$APP_DIR/patches/ptouch-print-cut-options.patch"
fi
cmake -S "$PTOUCH_SRC_DIR" -B "$PTOUCH_SRC_DIR/build" -DCMAKE_BUILD_TYPE=Release
cmake --build "$PTOUCH_SRC_DIR/build"
install -m 0755 "$PTOUCH_SRC_DIR/build/ptouch-print" /usr/local/bin/ptouch-print