Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/escpos/escpos.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,11 @@ def barcode(
if (not capable["hw"] and not capable["sw"]) or (
not capable["sw"] and force_software
):
raise BarcodeTypeError(f"""Profile {
raise BarcodeTypeError(
f"""Profile {
self.profile.profile_data['name']
} - hw barcode: {capable['hw']}, sw barcode: {capable['sw']}""")
} - hw barcode: {capable['hw']}, sw barcode: {capable['sw']}"""
)

bc_alnum = "".join([char for char in bc.upper() if char.isalnum()])
capable_bc = {
Expand Down Expand Up @@ -1626,7 +1628,10 @@ def __enter__(self, **kwargs: Any) -> "EscposIO":
return self

def __exit__(
self, type: type[BaseException], value: BaseException, traceback: TracebackType
self,
type: Optional[type[BaseException]],
value: Optional[BaseException],
traceback: Optional[TracebackType],
) -> None:
"""Cut and close if configured.

Expand Down
6 changes: 3 additions & 3 deletions src/escpos/printer/cups.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def __init__(self, printer_name: str = "", *args, **kwargs) -> None:
self.job_name = ""
self.pending_job = False

self._device: Union[Literal[False], Literal[None], Type[cups.Connection]] = (
False
)
self._device: Union[
Literal[False], Literal[None], Type[cups.Connection]
] = False

@property
def printers(self) -> dict:
Expand Down
6 changes: 3 additions & 3 deletions src/escpos/printer/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def __init__(
if idProduct:
self.usb_args["idProduct"] = idProduct

self._device: Union[Literal[False], Literal[None], Type[usb.core.Device]] = (
False
)
self._device: Union[
Literal[False], Literal[None], Type[usb.core.Device]
] = False

@dependency_usb
def open(self, raise_not_found: bool = True) -> None:
Expand Down
Loading