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

Fixed tabs and added charcode tables

This commit is contained in:
Manuel F Martinez
2014-05-20 22:15:54 -07:00
parent 51faf0a622
commit f6f1a4278f
5 changed files with 127 additions and 27 deletions

View File

@@ -22,6 +22,8 @@ class Error(Exception):
# 40 = Image height is too large
# 50 = No string supplied to be printed
# 60 = Invalid pin to send Cash Drawer pulse
# 70 = Invalid number of tab positions
# 80 = Invalid char code
class BarcodeTypeError(Error):
@@ -78,3 +80,23 @@ class CashDrawerError(Error):
def __str__(self):
return "Valid pin must be set to send pulse"
class TabError(Error):
def __init__(self, msg=""):
Error.__init__(self, msg)
self.msg = msg
self.resultcode = 70
def __str__(self):
return "Valid tab positions must be in the range 0 to 16"
class CharCodeError(Error):
def __init__(self, msg=""):
Error.__init__(self, msg)
self.msg = msg
self.resultcode = 70
def __str__(self):
return "Valid char code must be set"