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
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
- uses: actions/checkout@v7
- uses: psf/black@stable
with:
version: "23.12.0"
version: "26.5.1"

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ commands = [
[tool.tox.env.flake8]
base_python = ["python"]
deps = ["flake8", "flake8-docstrings"]
commands = [["flake8"]]
commands = [["flake8", "--version"], ["flake8"]]


[tool.tox.env.mypy]
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tests_require =
scripttest
mock
hypothesis>=6.83
flake8
flake8>7
sphinxcontrib-spelling>=8.0.0

[options.extras_require]
Expand All @@ -78,4 +78,4 @@ all =
[flake8]
exclude = .git,.venv,.tox,.github,.eggs,__pycache__,doc/conf.py,build,dist,capabilities-data,test,src/escpos/constants.py
max-line-length = 120
extend-ignore = E203, W503, D401
extend-ignore = E203, W503
1 change: 0 additions & 1 deletion src/escpos/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def load(self, config_path=None) -> None:
:param config_path: An optional file path, file handle, or byte string
for the configuration file.
"""

if not config_path:
config_path = os.path.join(
platformdirs.user_config_dir(self._app_name), self._config_file
Expand Down
10 changes: 4 additions & 6 deletions src/escpos/escpos.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _read(self) -> bytes:
raise NotImplementedError()

def set_sleep_in_fragment(self, sleep_time_ms: int) -> None:
"""Configures the currently active sleep time after sending a fragment.
"""Configure the currently active sleep time after sending a fragment.

If during printing an image an issue like "USBTimeoutError: [Errno 110]
Operation timed out" occurs, setting this value to roughly 300
Expand Down Expand Up @@ -599,11 +599,9 @@ def barcode(
if (not capable["hw"] and not capable["sw"]) or (
not capable["sw"] and force_software
):
raise BarcodeTypeError(
f"""Profile {
self.profile.profile_data['name']
} - hw barcode: {capable['hw']}, sw barcode: {capable['sw']}"""
)
raise BarcodeTypeError(f"""Profile {
self.profile.profile_data['name']
} - hw barcode: {capable['hw']}, sw barcode: {capable['sw']}""")

bc_alnum = "".join([char for char in bc.upper() if char.isalnum()])
capable_bc = {
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