Change the way a Printer is used by the worker
This commit is contained in:
@@ -75,6 +75,7 @@ class Printer(ABC):
|
||||
self.ready = False
|
||||
self.printer_type = printer_type
|
||||
self._lock = threading.Lock()
|
||||
self.used = False
|
||||
|
||||
@abstractmethod
|
||||
def _has_paper(self) -> bool:
|
||||
@@ -88,6 +89,13 @@ class Printer(ABC):
|
||||
def print_task(self, task_type, data) -> None:
|
||||
"""Takes a PrintTask and executes it"""
|
||||
|
||||
def use_printer(self) -> None:
|
||||
"""Marks the printer as being used """
|
||||
self.used = True
|
||||
|
||||
def free_printer(self) -> None:
|
||||
"""Marks the printer as being not used, it's available."""
|
||||
self.used = False
|
||||
|
||||
class EscPosPrinter(Printer):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user