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

REFACTOR style and PEP8, fixes #66

This commit is contained in:
Patrick Kanzler
2015-11-27 21:20:12 +01:00
parent 096445631f
commit 07d8e073ae
5 changed files with 128 additions and 152 deletions

View File

@@ -1,6 +1,5 @@
""" ESC/POS Exceptions classes """
import os
class Error(Exception):
""" Base class for ESC/POS errors """
@@ -35,6 +34,7 @@ class BarcodeTypeError(Error):
def __str__(self):
return "No Barcode type is defined"
class BarcodeSizeError(Error):
def __init__(self, msg=""):
Error.__init__(self, msg)
@@ -44,6 +44,7 @@ class BarcodeSizeError(Error):
def __str__(self):
return "Barcode size is out of range"
class BarcodeCodeError(Error):
def __init__(self, msg=""):
Error.__init__(self, msg)
@@ -53,6 +54,7 @@ class BarcodeCodeError(Error):
def __str__(self):
return "Code was not supplied"
class ImageSizeError(Error):
def __init__(self, msg=""):
Error.__init__(self, msg)
@@ -62,6 +64,7 @@ class ImageSizeError(Error):
def __str__(self):
return "Image height is longer than 255px and can't be printed"
class TextError(Error):
def __init__(self, msg=""):
Error.__init__(self, msg)