forked from pklaus/brother_ql_web
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for the labels module and work around
brother_ql
issues
- Loading branch information
1 parent
87ee072
commit 6822d03
Showing
12 changed files
with
419 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from __future__ import annotations | ||
|
||
import logging | ||
from typing import Any | ||
|
||
|
||
def patch_deprecation_warning() -> None: | ||
""" | ||
Avoid the deprecation warning from `brother_ql.devicedependent`. This has been | ||
fixed in the Git version, but not in PyPI one: | ||
https://github.com/pklaus/brother_ql/commit/5c2b72b18bcf436c116f180a9147cbb6805958f5 | ||
""" | ||
original_logger = logging.getLogger("brother_ql.devicedependent").warning | ||
|
||
def warn(message: str, *args: Any, **kwargs: Any) -> None: | ||
if ( | ||
message | ||
== "deprecation warning: brother_ql.devicedependent is deprecated and will be removed in a future release" # noqa: E501 | ||
): | ||
return | ||
original_logger(message, *args, **kwargs) | ||
|
||
logging.getLogger("brother_ql.devicedependent").warn = warn # type: ignore[assignment,method-assign] # noqa: E501 | ||
|
||
|
||
patch_deprecation_warning() | ||
|
||
|
||
import brother_ql.conversion # noqa: E402 | ||
import PIL # noqa: E402 | ||
|
||
|
||
# Renamed in version 2.7.0: | ||
# https://pillow.readthedocs.io/en/stable/releasenotes/2.7.0.html#antialias-renamed-to-lanczos | ||
brother_ql.conversion.Image.ANTIALIAS = PIL.Image.LANCZOS # type: ignore[attr-defined] | ||
|
||
|
||
__all__: list[str] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.