use Union

This commit is contained in:
Patrick Kanzler 2023-08-15 00:43:09 +02:00
parent 7ce4453b3d
commit aae551b4ce

View File

@ -14,6 +14,7 @@ This module contains the abstract base class :py:class:`Escpos`.
import textwrap import textwrap
from abc import ABCMeta, abstractmethod # abstract base class support from abc import ABCMeta, abstractmethod # abstract base class support
from re import match as re_match from re import match as re_match
from typing import Union
import barcode import barcode
import qrcode import qrcode
@ -737,9 +738,9 @@ class Escpos(object):
barcode_type, barcode_type,
data, data,
impl: str = "bitImageColumn", impl: str = "bitImageColumn",
module_height: (int | float) = 5, module_height: Union[int, float] = 5,
module_width: (int | float) = 0.2, module_width: Union[int, float] = 0.2,
text_distance: (int | float) = 5, text_distance: Union[int, float] = 5,
font_size: int = 10, font_size: int = 10,
center: bool = True, center: bool = True,
): ):
@ -783,13 +784,13 @@ class Escpos(object):
* bitImageRaster * bitImageRaster
:param module_height: barcode module height (in mm). :param module_height: barcode module height (in mm).
:type module_height: (int | float) :type module_height: Union[int, float]
:param module_width: barcode module width (in mm). :param module_width: barcode module width (in mm).
:type module_width: (int | float) :type module_width: Union[int, float]
:param text_distance: distance from the barcode to the code text (in mm). :param text_distance: distance from the barcode to the code text (in mm).
:type text_distance: (int | float) :type text_distance: Union[int, float]
:param font_size: font size of the code text (in dots). :param font_size: font size of the code text (in dots).
:type font_size: int :type font_size: int