diff --git a/.github/workflows/pythonpackage-windows.yml b/.github/workflows/pythonpackage-windows.yml index aaccb68..140e218 100644 --- a/.github/workflows/pythonpackage-windows.yml +++ b/.github/workflows/pythonpackage-windows.yml @@ -12,7 +12,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ['3.10', '3.11'] + python-version: ['3.11', '3.12'] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e10e810..addc9e3 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 diff --git a/setup.cfg b/setup.cfg index dbdfcfa..44836c4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,6 +22,7 @@ classifiers = Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Programming Language :: Python :: Implementation :: CPython Topic :: Software Development :: Libraries :: Python Modules Topic :: Office/Business :: Financial :: Point-Of-Sale diff --git a/src/escpos/constants.py b/src/escpos/constants.py index f6bfcea..5328f4e 100644 --- a/src/escpos/constants.py +++ b/src/escpos/constants.py @@ -249,23 +249,26 @@ BARCODE_TYPE_B: Dict[str, bytes] = { #: supported barcode formats BARCODE_FORMATS = { - "UPC-A": ([(11, 12)], "^[0-9]{11,12}$"), - "UPC-E": ([(7, 8), (11, 12)], "^([0-9]{7,8}|[0-9]{11,12})$"), - "EAN13": ([(12, 13)], "^[0-9]{12,13}$"), - "EAN8": ([(7, 8)], "^[0-9]{7,8}$"), - "CODE39": ([(1, 255)], "^([0-9A-Z \$\%\+\-\.\/]+|\*[0-9A-Z \$\%\+\-\.\/]+\*)$"), - "ITF": ([(2, 255)], "^([0-9]{2})+$"), - "NW7": ([(1, 255)], "^[A-Da-d][0-9\$\+\-\.\/\:]+[A-Da-d]$"), - "CODABAR": ([(1, 255)], "^[A-Da-d][0-9\$\+\-\.\/\:]+[A-Da-d]$"), # Same as NW7 - "CODE93": ([(1, 255)], "^[\\x00-\\x7F]+$"), - "CODE128": ([(2, 255)], "^\{[A-C][\\x00-\\x7F]+$"), - "GS1-128": ([(2, 255)], "^\{[A-C][\\x00-\\x7F]+$"), # same as CODE128 - "GS1 DATABAR OMNIDIRECTIONAL": ([(13, 13)], "^[0-9]{13}$"), - "GS1 DATABAR TRUNCATED": ([(13, 13)], "^[0-9]{13}$"), # same as GS1 omnidirectional - "GS1 DATABAR LIMITED": ([(13, 13)], "^[01][0-9]{12}$"), + "UPC-A": ([(11, 12)], r"^[0-9]{11,12}$"), + "UPC-E": ([(7, 8), (11, 12)], r"^([0-9]{7,8}|[0-9]{11,12})$"), + "EAN13": ([(12, 13)], r"^[0-9]{12,13}$"), + "EAN8": ([(7, 8)], r"^[0-9]{7,8}$"), + "CODE39": ([(1, 255)], r"^([0-9A-Z \$\%\+\-\.\/]+|\*[0-9A-Z \$\%\+\-\.\/]+\*)$"), + "ITF": ([(2, 255)], r"^([0-9]{2})+$"), + "NW7": ([(1, 255)], r"^[A-Da-d][0-9\$\+\-\.\/\:]+[A-Da-d]$"), + "CODABAR": ([(1, 255)], r"^[A-Da-d][0-9\$\+\-\.\/\:]+[A-Da-d]$"), # Same as NW7 + "CODE93": ([(1, 255)], r"^[\x00-\x7F]+$"), + "CODE128": ([(2, 255)], r"^\{[A-C][\x00-\x7F]+$"), + "GS1-128": ([(2, 255)], r"^\{[A-C][\x00-\x7F]+$"), # same as CODE128 + "GS1 DATABAR OMNIDIRECTIONAL": ([(13, 13)], r"^[0-9]{13}$"), + "GS1 DATABAR TRUNCATED": ( + [(13, 13)], + r"^[0-9]{13}$", + ), # same as GS1 omnidirectional + "GS1 DATABAR LIMITED": ([(13, 13)], r"^[01][0-9]{12}$"), "GS1 DATABAR EXPANDED": ( [(2, 255)], - "^\([0-9][A-Za-z0-9 \!\"\%\&'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\_\{]+$", + r"^\([0-9][A-Za-z0-9 \!\"\%\&'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\_\{]+$", ), }