Improve linting of printer class
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
|
||||
"""
|
||||
This class manages connexion to a Printer
|
||||
"""
|
||||
# import brother_ql
|
||||
from time import sleep
|
||||
import os.path
|
||||
@@ -10,7 +12,7 @@ import numpy as np
|
||||
import escpos.printer
|
||||
|
||||
|
||||
class Printer(object):
|
||||
class Printer():
|
||||
"""
|
||||
# The connection is based on the ESC/POS library
|
||||
|
||||
@@ -31,7 +33,7 @@ class Printer(object):
|
||||
ready = False
|
||||
|
||||
def __init__(self, app, device_id, vendor_id):
|
||||
super(Printer, self).__init__()
|
||||
super().__init__()
|
||||
self.app = app
|
||||
self.ready = False
|
||||
self.printer = None
|
||||
@@ -99,7 +101,6 @@ class Printer(object):
|
||||
waiting_elapsed,
|
||||
str(e),
|
||||
)
|
||||
pass
|
||||
|
||||
sleep(1)
|
||||
waiting_elapsed -= 1
|
||||
@@ -207,7 +208,7 @@ class Printer(object):
|
||||
+ str(path)
|
||||
+ " wasn't found. Please try again."
|
||||
)
|
||||
else:
|
||||
|
||||
self.app.logger.debug("Printing file from " + str(path))
|
||||
|
||||
if process:
|
||||
@@ -309,7 +310,8 @@ def _process_image(self, path):
|
||||
self.app.logger.debug("Resized the image")
|
||||
|
||||
# # Convert to grayscale for dithering
|
||||
# dithered_img = original_img.convert("L").convert("1") # Dithering using default method (Floyd–Steinberg)
|
||||
# dithered_img = original_img.convert("L").convert("1")
|
||||
# Dithering using default method (Floyd–Steinberg)
|
||||
# self.app.logger.debug("Dithered the image")
|
||||
|
||||
# Compute brightness of original image (grayscale average)
|
||||
|
||||
Reference in New Issue
Block a user