fix lp on nix
This commit is contained in:
parent
b0c19d5642
commit
2d61260583
2 changed files with 7 additions and 2 deletions
|
|
@ -68,7 +68,12 @@ def upload_and_print():
|
||||||
app.logger.info(
|
app.logger.info(
|
||||||
f"Sending '{filename}' ({page_count} pages) to printer '{PRINTER_NAME}'"
|
f"Sending '{filename}' ({page_count} pages) to printer '{PRINTER_NAME}'"
|
||||||
)
|
)
|
||||||
command = ["lp", "-d", PRINTER_NAME, filepath]
|
command = [
|
||||||
|
"lp",
|
||||||
|
"-d",
|
||||||
|
PRINTER_NAME,
|
||||||
|
filepath,
|
||||||
|
]
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
command, capture_output=True, text=True, check=True
|
command, capture_output=True, text=True, check=True
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
<form action="/" method="post" enctype="multipart/form-data">
|
<form action="{{ url_for('upload_and_print') }}" method="post" enctype="multipart/form-data">
|
||||||
<div class="border-2 border-dashed border-gray-300 rounded-lg p-8 text-center bg-gray-50 hover:border-blue-500 transition-colors duration-300">
|
<div class="border-2 border-dashed border-gray-300 rounded-lg p-8 text-center bg-gray-50 hover:border-blue-500 transition-colors duration-300">
|
||||||
<label for="file-upload" class="cursor-pointer">
|
<label for="file-upload" class="cursor-pointer">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-12 h-12 mx-auto text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1">
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-12 h-12 mx-auto text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue