From 7e9cbf611ae8f1bdd2ca809ddd8b505baa628cb6 Mon Sep 17 00:00:00 2001 From: csoft2k Date: Sun, 23 Jul 2017 11:35:12 +0200 Subject: [PATCH] Syntax changes. Change the value check syntax. Change the offline array returned to use a constant. --- src/escpos/escpos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/escpos/escpos.py b/src/escpos/escpos.py index c37355e..a986304 100644 --- a/src/escpos/escpos.py +++ b/src/escpos/escpos.py @@ -747,13 +747,13 @@ class Escpos(object): self._raw(RT_STATUS_ONLINE) time.sleep(1) status = self._read() - return status or [8] + return status or [RT_MASK_ONLINE] def is_online(self): """ Queries the printer its online status. When online, returns True; False otherwise. :rtype: bool: True if online, False if offline.""" - return (self.query_status()[0] & RT_MASK_ONLINE) == 0 + return not (self.query_status()[0] & RT_MASK_ONLINE) class EscposIO(object):