|
12 | 12 | from __future__ import annotations |
13 | 13 |
|
14 | 14 | import warnings |
15 | | -from typing import Callable, Optional |
| 15 | +from typing import Any, Callable, Optional, TypeAlias |
16 | 16 | from ctypes import * |
17 | 17 |
|
18 | 18 | # Import all the raw bindings |
19 | 19 | from . import webui_bindings as _raw |
20 | 20 |
|
21 | 21 |
|
22 | | - |
23 | 22 | # C function type for the file handler window |
24 | 23 | filehandler_window_callback = CFUNCTYPE(c_void_p, c_size_t, c_char_p, POINTER(c_int)) |
25 | 24 |
|
@@ -308,7 +307,7 @@ def script_client(self, script: str, timeout: int = 0, buffer_size: int = 4096) |
308 | 307 | # Initializing Result |
309 | 308 | res = JavaScript() |
310 | 309 |
|
311 | | - res.data = buffer.value.decode('utf-8', errors='ignore') |
| 310 | + res.data = buffer.value.decode('utf-8', errors='ignore') # type: ignore |
312 | 311 | res.error = not success |
313 | 312 | return res |
314 | 313 |
|
@@ -619,8 +618,8 @@ def __init__(self, window_id: Optional[int] = None): |
619 | 618 | self._cb_func_list: dict = {} |
620 | 619 |
|
621 | 620 | # 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 = [] |
| 621 | + self._file_handler_cb: Any = None |
| 622 | + self._buffers: list = [] |
624 | 623 |
|
625 | 624 | # -- dispatcher for function bindings ----------- |
626 | 625 | def _make_dispatcher(self): |
@@ -1051,7 +1050,7 @@ def send_raw(self, function: str, raw: Optional[c_void_p], size: int) -> None: |
1051 | 1050 | _raw.webui_send_raw( |
1052 | 1051 | c_size_t(self._window), |
1053 | 1052 | c_char_p(function.encode("utf-8")), |
1054 | | - c_void_p(raw), |
| 1053 | + c_void_p(raw), # type: ignore |
1055 | 1054 | c_size_t(size) |
1056 | 1055 | ) |
1057 | 1056 |
|
@@ -1397,7 +1396,7 @@ def script(self, script: str, timeout: int = 0, buffer_size: int = 4096) -> Java |
1397 | 1396 | # Initializing Result |
1398 | 1397 | res = JavaScript() |
1399 | 1398 |
|
1400 | | - res.data = buffer.value.decode('utf-8', errors='ignore') |
| 1399 | + res.data = buffer.value.decode('utf-8', errors='ignore') # type: ignore |
1401 | 1400 | res.error = not success |
1402 | 1401 | return res |
1403 | 1402 |
|
|
0 commit comments