From 8134c5e892f657bed86b6bae3b8ff4e74bb867e1 Mon Sep 17 00:00:00 2001 From: n07070 Date: Tue, 26 May 2026 23:56:55 +0200 Subject: [PATCH] Improve linting of printer class --- src/printer.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/printer.py b/src/printer.py index bbd0514..66a781f 100644 --- a/src/printer.py +++ b/src/printer.py @@ -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,8 +208,8 @@ class Printer(object): + str(path) + " wasn't found. Please try again." ) - else: - self.app.logger.debug("Printing file from " + str(path)) + + self.app.logger.debug("Printing file from " + str(path)) if process: try: @@ -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)