From 4392e811e689376c5921ee8b8dea2ba4b194f430 Mon Sep 17 00:00:00 2001 From: Ignacio Rivero Date: Tue, 24 Jun 2025 21:45:38 -0300 Subject: [PATCH] thought json was not built in oops, also fixed intensity permanence --- app.py | 19 ++++++++++++++++--- requirements.txt | 1 - templates/index.html | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 6827be3..98ff656 100644 --- a/app.py +++ b/app.py @@ -416,7 +416,7 @@ def index(): if intensity < 0 or intensity > 100: raise ValueError("Intensity must be between 0 and 100") except ValueError: - error = "Intensidad debe ser un nĂºmero entre 0 y 100" + error = "Intensity must be a number between 0 and 100" intensity = 85 session['intensity'] = intensity # If print button pressed, send to driver @@ -438,8 +438,21 @@ def index(): printed = True except Exception as e: error = f"Failed to print: {e}" - return render_template("index.html", dithering_modes=dithering_modes, img=img_data, default_md=md, - printed=printed, error=error, current_dithering=session.get('dithering', 'floyd'), current_rotation=session.get('rotation', 0), current_printmode=session.get('printmode', '1bpp'), current_bannermode=session.get('bannermode', False), t=t, lang=lang) + return render_template( + "index.html", + dithering_modes=dithering_modes, + img=img_data, + default_md=md, + printed=printed, + error=error, + current_intensity=session.get('intensity', 85), + current_dithering=session.get('dithering', 'floyd'), + current_rotation=session.get('rotation', 0), + current_printmode=session.get('printmode', '1bpp'), + current_bannermode=session.get('bannermode', False), + t=t, + lang=lang + ) @app.route('/manifest.json') def manifest(): diff --git a/requirements.txt b/requirements.txt index 8a3aec6..2eacab7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,3 @@ Flask markdown Pillow requests -json \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 5c729db..d795371 100644 --- a/templates/index.html +++ b/templates/index.html @@ -560,7 +560,7 @@
- +