Skip to content

Commit a02f563

Browse files
authored
clean up typing in main module
1 parent 94f9bb7 commit a02f563

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

PyPI/Package/src/webui/webui.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
from __future__ import annotations
1313

1414
import warnings
15-
from typing import Callable, Optional
15+
from typing import Callable, Optional, TypeAlias
1616
from ctypes import *
1717

1818
# Import all the raw bindings
1919
from . import webui_bindings as _raw
2020

2121

22-
22+
_FileHandlerCallback: TypeAlias = _raw.FILE_HANDLER_CB
2323
# C function type for the file handler window
2424
filehandler_window_callback = CFUNCTYPE(c_void_p, c_size_t, c_char_p, POINTER(c_int))
2525

@@ -308,7 +308,7 @@ def script_client(self, script: str, timeout: int = 0, buffer_size: int = 4096)
308308
# Initializing Result
309309
res = JavaScript()
310310

311-
res.data = buffer.value.decode('utf-8', errors='ignore')
311+
res.data = buffer.value.decode('utf-8', errors='ignore') # type: ignore
312312
res.error = not success
313313
return res
314314

@@ -619,8 +619,8 @@ def __init__(self, window_id: Optional[int] = None):
619619
self._cb_func_list: dict = {}
620620

621621
# gets used for both filehandler and filehandler_window, should wipe out the other just how it does in C
622-
self._file_handler_cb: _raw.FILE_HANDLER_CB = None
623-
self._buffers = []
622+
self._file_handler_cb: _FileHandlerCallback = None
623+
self._buffers: list = []
624624

625625
# -- dispatcher for function bindings -----------
626626
def _make_dispatcher(self):
@@ -1051,7 +1051,7 @@ def send_raw(self, function: str, raw: Optional[c_void_p], size: int) -> None:
10511051
_raw.webui_send_raw(
10521052
c_size_t(self._window),
10531053
c_char_p(function.encode("utf-8")),
1054-
c_void_p(raw),
1054+
c_void_p(raw), # type: ignore
10551055
c_size_t(size)
10561056
)
10571057

@@ -1397,7 +1397,7 @@ def script(self, script: str, timeout: int = 0, buffer_size: int = 4096) -> Java
13971397
# Initializing Result
13981398
res = JavaScript()
13991399

1400-
res.data = buffer.value.decode('utf-8', errors='ignore')
1400+
res.data = buffer.value.decode('utf-8', errors='ignore') # type: ignore
14011401
res.error = not success
14021402
return res
14031403

0 commit comments

Comments
 (0)