1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-09-13 09:09:58 +00:00

Feature/check barcodes (#255)

* add a method to check barcode code format

ensure that the code to print is compatible with the ESC/POS formats and
also automatically check this format before printing (barcode() method).

* rewrite test using pytest's parametrize functionality

* add test for the 'check' argument

* update authors list
This commit is contained in:
Lucy Linder
2017-10-08 20:05:18 +02:00
committed by Patrick Kanzler
parent d78a6f1699
commit 456f5b7aa6
6 changed files with 187 additions and 12 deletions

View File

@@ -77,9 +77,10 @@ class BarcodeSizeError(Error):
class BarcodeCodeError(Error):
""" No Barcode code was supplied.
""" No Barcode code was supplied, or it is incorrect.
No data for the barcode has been supplied in :py:meth:`escpos.escpos.Escpos.barcode`.
No data for the barcode has been supplied in :py:meth:`escpos.escpos.Escpos.barcode` or the the `check` parameter
was True and the check failed.
The returncode for this exception is `30`.
"""
def __init__(self, msg=""):