1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-12-02 09:43:30 +00:00

REFACTOR replace % op with format were it is easy

This commit is contained in:
Patrick Kanzler
2016-01-08 03:43:33 +01:00
parent f25521f22f
commit 41c6afd3b8
4 changed files with 11 additions and 11 deletions

View File

@@ -56,13 +56,13 @@ class Usb(Escpos):
self.device.detach_kernel_driver(0)
except usb.core.USBError as e:
if check_driver is not None:
print("Could not detatch kernel driver: %s" % str(e))
print("Could not detatch kernel driver: {0}".format(str(e)))
try:
self.device.set_configuration()
self.device.reset()
except usb.core.USBError as e:
print("Could not set configuration: %s" % str(e))
print("Could not set configuration: {0}".format(str(e)))
def _raw(self, msg):
""" Print any command sent in raw format
@@ -120,7 +120,7 @@ class Serial(Escpos):
if self.device is not None:
print("Serial printer enabled")
else:
print("Unable to open serial printer on: %s" % self.devfile)
print("Unable to open serial printer on: {0}".format(str(self.devfile)))
def _raw(self, msg):
""" Print any command sent in raw format
@@ -159,7 +159,7 @@ class Network(Escpos):
self.device.connect((self.host, self.port))
if self.device is None:
print("Could not open socket for %s" % self.host)
print("Could not open socket for {0}".format(self.host))
def _raw(self, msg):
""" Print any command sent in raw format
@@ -195,7 +195,7 @@ class File(Escpos):
self.device = open(self.devfile, "wb")
if self.device is None:
print("Could not open the specified file %s" % self.devfile)
print("Could not open the specified file {0}".format(self.devfile))
def flush(self):
""" Flush printing content """