From 651235a610e89b2810673048a18ef2fee1b3c291 Mon Sep 17 00:00:00 2001 From: n07070 Date: Thu, 4 Jun 2026 00:34:49 +0200 Subject: [PATCH] Lint printer file --- src/printer.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/printer.py b/src/printer.py index 222c847..abd8d5a 100644 --- a/src/printer.py +++ b/src/printer.py @@ -2,7 +2,6 @@ This class manages connexion to a Printer """ -from time import sleep import os.path import os from abc import ABC, abstractmethod @@ -10,8 +9,8 @@ from dataclasses import dataclass from enum import Enum import uuid -import usb.core import threading +import usb.core from PIL import Image, ImageEnhance import numpy as np @@ -20,7 +19,6 @@ import numpy as np import escpos.printer from brother_ql.models import ModelsManager from brother_ql.backends import backend_factory -from brother_ql import labels from brother_ql.raster import BrotherQLRaster from brother_ql.conversion import convert from brother_ql.backends.helpers import send @@ -38,6 +36,9 @@ class PrinterType(Enum): # For Brother-QL Printers @dataclass class PrinterInfo: + """ + Brother-QL printer information + """ identifier: str backend: str protocol: str @@ -375,7 +376,7 @@ class BrotherPrinter(Printer): continue protocol = parts[0] - device_info = parts[2] + # device_info = parts[2] serial_number = parts[3] try: @@ -513,7 +514,7 @@ class BrotherPrinter(Printer): def _process_image(self, path): brightness_factor = 1.5 # Used only if image is too dark brightness_threshold = 100 # Brightness threshold (0–255) - contrast_factor = 0.6 # Less than 1.0 = lower contrast + # contrast_factor = 0.6 # Less than 1.0 = lower contrast max_width = 575 max_height = 1000