diff --git a/src/escpos/printer/cups.py b/src/escpos/printer/cups.py index 3900cc6..c7eff06 100644 --- a/src/escpos/printer/cups.py +++ b/src/escpos/printer/cups.py @@ -181,4 +181,4 @@ class CupsPrinter(Escpos): if self.pending_job: self.send() print(f"Closing CUPS connection to printer {self.printer_name}") - self.device = None + self._device = False diff --git a/src/escpos/printer/file.py b/src/escpos/printer/file.py index e2cdad4..9eaef9a 100644 --- a/src/escpos/printer/file.py +++ b/src/escpos/printer/file.py @@ -76,4 +76,4 @@ class File(Escpos): return self.device.flush() self.device.close() - self.device = None + self._device = False diff --git a/src/escpos/printer/lp.py b/src/escpos/printer/lp.py index a416082..3ccacfa 100644 --- a/src/escpos/printer/lp.py +++ b/src/escpos/printer/lp.py @@ -87,7 +87,7 @@ class LP(Escpos): if not self._device: return self.device.terminate() - self.device = None + self._device = False def flush(self): """End line and wait for new commands.""" diff --git a/src/escpos/printer/network.py b/src/escpos/printer/network.py index 3a84840..a33c7ff 100644 --- a/src/escpos/printer/network.py +++ b/src/escpos/printer/network.py @@ -92,4 +92,4 @@ class Network(Escpos): except socket.error: pass self.device.close() - self.device = None + self._device = False diff --git a/src/escpos/printer/serial.py b/src/escpos/printer/serial.py index 0ba1610..39588c9 100644 --- a/src/escpos/printer/serial.py +++ b/src/escpos/printer/serial.py @@ -151,4 +151,4 @@ class Serial(Escpos): if self.device.is_open: self.device.flush() self.device.close() - self.device = None + self._device = False diff --git a/src/escpos/printer/usb.py b/src/escpos/printer/usb.py index 12766ae..3295096 100644 --- a/src/escpos/printer/usb.py +++ b/src/escpos/printer/usb.py @@ -156,4 +156,4 @@ class Usb(Escpos): if not self._device: return usb.util.dispose_resources(self.device) - self.device = None + self._device = False diff --git a/src/escpos/printer/win32raw.py b/src/escpos/printer/win32raw.py index 7658fc5..e7f18ab 100644 --- a/src/escpos/printer/win32raw.py +++ b/src/escpos/printer/win32raw.py @@ -97,7 +97,7 @@ class Win32Raw(Escpos): win32print.EndPagePrinter(self.device) win32print.EndDocPrinter(self.device) win32print.ClosePrinter(self.device) - self.device = None + self._device = False @dependency_win32print def _raw(self, msg):