summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2024-07-08 05:37:53 +0300
committerMaxim Devaev <[email protected]>2024-07-19 15:25:14 +0300
commit8ef1545729298159769e5804feb50ededc5487ea (patch)
treec28bb2ead364e3819dbb2b664f489af5c7907792
parent44e58d8d062bee501fa3016c6464987d741d661f (diff)
lint fix
-rw-r--r--kvmd/apps/kvmd/ocr.py4
-rw-r--r--kvmd/plugins/hid/spi.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/kvmd/apps/kvmd/ocr.py b/kvmd/apps/kvmd/ocr.py
index 2b669e68..bd30afa6 100644
--- a/kvmd/apps/kvmd/ocr.py
+++ b/kvmd/apps/kvmd/ocr.py
@@ -145,12 +145,12 @@ class Ocr:
if left < right and top < bottom:
image_cropped = image.crop((left, top, right, bottom))
image.close()
- image = image_cropped
+ image = image_cropped # type: ignore
ImageOps.grayscale(image)
image_resized = image.resize((int(image.size[0] * 2), int(image.size[1] * 2)), PilImage.Resampling.BICUBIC)
image.close()
- image = image_resized
+ image = image_resized # type: ignore
_libtess.TessBaseAPISetImage(api, image.tobytes("raw", "RGB"), image.width, image.height, 3, image.width * 3)
text_ptr = None
diff --git a/kvmd/plugins/hid/spi.py b/kvmd/plugins/hid/spi.py
index 278e68e1..dadcc77e 100644
--- a/kvmd/plugins/hid/spi.py
+++ b/kvmd/plugins/hid/spi.py
@@ -120,8 +120,8 @@ class _SpiPhy(BasePhy): # pylint: disable=too-many-instance-attributes
return os.path.exists(f"/dev/spidev{self.__bus}.{self.__chip}")
@contextlib.contextmanager
- def connected(self) -> Generator[_SpiPhyConnection, None, None]: # pylint: disable=contextmanager-generator-missing-cleanup # type: ignore
- with self.__sw_cs_connected() as switch_cs:
+ def connected(self) -> Generator[_SpiPhyConnection, None, None]: # type: ignore
+ with self.__sw_cs_connected() as switch_cs: # pylint: disable=contextmanager-generator-missing-cleanup
with contextlib.closing(spidev.SpiDev(self.__bus, self.__chip)) as spi:
spi.mode = 0
spi.no_cs = (not self.__hw_cs)