f
This commit is contained in:
parent
c51c95c42b
commit
d028ecb842
11
app.py
11
app.py
@ -85,12 +85,13 @@ def print_address_label(pdf_path):
|
|||||||
)
|
)
|
||||||
|
|
||||||
app.logger.info("Sending to printer...")
|
app.logger.info("Sending to printer...")
|
||||||
send(
|
status = send(
|
||||||
instructions=instructions,
|
instructions=instructions,
|
||||||
printer_identifier=printer,
|
printer_identifier=printer,
|
||||||
backend_identifier=backend,
|
backend_identifier=backend,
|
||||||
blocking=True
|
blocking=True
|
||||||
)
|
)
|
||||||
|
print(status)
|
||||||
app.logger.info("Print job sent successfully")
|
app.logger.info("Print job sent successfully")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -106,14 +107,6 @@ def process_queue():
|
|||||||
# Process the file (convert and print)
|
# Process the file (convert and print)
|
||||||
app.logger.info(f"Processing file: {file_path}")
|
app.logger.info(f"Processing file: {file_path}")
|
||||||
print_address_label(file_path)
|
print_address_label(file_path)
|
||||||
wait = 15
|
|
||||||
while wait > 0:
|
|
||||||
# get printer status
|
|
||||||
printer_status = status(printer_model, printer_identifier=printer, backend_identifier=backend)
|
|
||||||
app.logger.info(f"Printer status: {printer_status}")
|
|
||||||
print(printer_status)
|
|
||||||
time.sleep(1)
|
|
||||||
wait -= 1
|
|
||||||
# Signal that the task is done
|
# Signal that the task is done
|
||||||
file_queue.task_done()
|
file_queue.task_done()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user