Update the import of the printer package

This commit is contained in:
n07070
2026-05-18 23:19:21 +02:00
parent 6254d60429
commit b0e394f9d1

View File

@@ -1,5 +1,5 @@
# Importing the module to mage the connection to the printer.
from escpos.printer import Usb, USBNotFoundError
# Importing the module to manage the connection to the printer.
import escpos.printer as escp
from time import sleep, gmtime, strftime
import os.path
from PIL import Image, ImageEnhance, ImageOps
@@ -66,8 +66,8 @@ class Printer(object):
try:
# This also calls open(), which we need to close()
# or else the device will appear as busy.
p = Usb(self.device_id, self.vendor_id, 0, profile="TM-P80")
except USBNotFoundError as e:
p = escp.Usb(self.device_id, self.vendor_id, 0, profile="TM-P80")
except Exception as e:
self.app.logger.error(
"The USB device is not plugged in, trying again : " + str(e)
)