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