DOC change type of msg for _raw to bytes

This commit is contained in:
Patrick Kanzler 2016-03-03 03:37:43 +01:00
parent 18518fa901
commit 7005ba5899
2 changed files with 5 additions and 0 deletions

View File

@ -52,6 +52,7 @@ class Escpos(object):
This function has to be individually implemented by the implementations.
:param msg: message string to be sent to the printer
:type msg: bytes
"""
pass

View File

@ -79,6 +79,7 @@ class Usb(Escpos):
""" Print any command sent in raw format
:param msg: arbitrary code to be printed
:type msg: bytes
"""
self.device.write(self.out_ep, msg, self.interface)
@ -143,6 +144,7 @@ class Serial(Escpos):
""" Print any command sent in raw format
:param msg: arbitrary code to be printed
:type msg: bytes
"""
self.device.write(msg)
@ -201,6 +203,7 @@ class Network(Escpos):
""" Print any command sent in raw format
:param msg: arbitrary code to be printed
:type msg: bytes
"""
self.device.sendall(msg)
@ -247,6 +250,7 @@ class File(Escpos):
""" Print any command sent in raw format
:param msg: arbitrary code to be printed
:type msg: bytes
"""
if type(msg) is str:
self.device.write(msg.encode())