Apply black formatter

This commit is contained in:
n07070 committed 2026-10-11 21:46:05 +02:00
1 parent 0e0197e11c
commit 0c759dce9c
8 files changed
+103 -49

No files matched your search

+5 -1
View File
@@ -14,6 +14,7 @@ to print at the same time.
We can also delay and store printing tasks until a printer becomes
available if none is online.
"""
from abc import ABC, abstractmethod
## See https://docs.python.org/3/library/abc.html to learn more about this
@@ -27,6 +28,7 @@ class TaskType(Enum):
"""
The different tasks supported by the printers
"""
TEXT = "text"
IMAGE = "image"
CUT = "cut"
@@ -47,7 +49,6 @@ class PrintTask(ABC):
def get_print_data(self):
"""Return data formatted for printer"""
def _generate_id(self):
# Generate unique task ID
return str(uuid.uuid4())
@@ -66,8 +67,10 @@ class TextTask(PrintTask):
def get_print_data(self):
return {"txt": self.content, "sign": self.signature}
class QRTask(TextTask):
"""This task prints a QR-Code, the signature is ignore and is always the content itself"""
def __init__(self, content):
super().__init__(content, signature="")
self.content = content
@@ -76,6 +79,7 @@ class QRTask(TextTask):
def get_print_data(self):
return {"txt": self.content, "sign": self.signature}
class ImageTask(PrintTask):
"""
This tasks represents a image content ( in the form of it's path ), and it's signature.