From 96e804764fef86b3a6e57a2ef9dbdb774f7847db Mon Sep 17 00:00:00 2001 From: Jan Umbach Date: Mon, 31 Jul 2023 18:43:22 +0200 Subject: [PATCH] added start and install script --- .gitignore | 2 ++ install.sh | 11 +++++++++++ main.py | 3 ++- start.sh | 8 ++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 install.sh create mode 100644 start.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9728dff --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +label.png +.venv/ diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..15f794c --- /dev/null +++ b/install.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +BASEDIR=$(dirname "$0") +echo "installing LabelPrinting in $BASEDIR" +cd $BASEDIR + +python3 -m venv .venv +. .venv/bin/activate +pip install -r requirements.txt + +echo "Done" \ No newline at end of file diff --git a/main.py b/main.py index 3fae14a..b1683d1 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,8 @@ from watchdog.events import LoggingEventHandler from pdf2image import convert_from_path -labelPathDir = "/home/jan/Downloads/" +downloads_path = str(Path.home() / "Downloads") +labelPathDir = downloads_path labelPath = labelPathDir + "label.pdf" labelPathRot90 = labelPathDir + "label_rot90.pdf" diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..ffaf87e --- /dev/null +++ b/start.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +BASEDIR=$(dirname "$0") +echo "Running LabelPrinting script in Loop:" +cd $BASEDIR + +. .venv/bin/activate +python3 main.py