add default value to get call

This commit is contained in:
Patrick Kanzler 2023-09-04 00:57:19 +02:00
parent f87f224601
commit a828d8b9ef

View File

@ -573,7 +573,7 @@ class Escpos(object):
def _hw_barcode( def _hw_barcode(
self, self,
code, code,
bc, bc: str,
height: int = 64, height: int = 64,
width: int = 3, width: int = 3,
pos: str = "BELOW", pos: str = "BELOW",
@ -660,7 +660,7 @@ class Escpos(object):
:py:exc:`~escpos.exceptions.BarcodeCodeError` :py:exc:`~escpos.exceptions.BarcodeCodeError`
""" """
# If function_type is specified, otherwise use guessing. # If function_type is specified, otherwise use guessing.
ft_guess = [ft for ft in ["A", "B"] if bc in BARCODE_TYPES.get(ft)] ft_guess = [ft for ft in ["A", "B"] if bc in BARCODE_TYPES.get(ft, {"": b""})]
ft_guess = ft_guess or [None] ft_guess = ft_guess or [None]
function_type = function_type or ft_guess[0] function_type = function_type or ft_guess[0]