Skip to content

Commit 62afb76

Browse files
Merge branch 'main' into send_raw_fix
2 parents 952b7e6 + a96d130 commit 62afb76

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

PyPI/Package/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ classifiers = [
1515
"Programming Language :: Python :: 3",
1616
"License :: OSI Approved :: MIT License",
1717
"Operating System :: OS Independent",
18+
"Typing :: Typed",
1819
]
1920

2021
[project.urls]

PyPI/Package/src/webui/load_library.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _download_library():
5656

5757

5858
# Load WebUI Dynamic Library
59-
def load_library() -> CDLL:
59+
def load_library() -> CDLL | None:
6060
library: CDLL | None = None
6161
lib_path = _get_library_path()
6262
if not os.path.exists(lib_path):
@@ -87,4 +87,4 @@ def load_library() -> CDLL:
8787
else:
8888
print("Unsupported OS")
8989

90-
return library
90+
return library

PyPI/Package/src/webui/py.typed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

PyPI/Package/src/webui/webui.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313

1414
import array
1515
import warnings
16-
from typing import Callable, Optional
16+
from typing import Any, Callable, Optional, TypeAlias
1717
from ctypes import *
1818

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

2222

23-
2423
# C function type for the file handler window
2524
filehandler_window_callback = CFUNCTYPE(c_void_p, c_size_t, c_char_p, POINTER(c_int))
2625

@@ -325,7 +324,7 @@ def script_client(self, script: str, timeout: int = 0, buffer_size: int = 4096)
325324
# Initializing Result
326325
res = JavaScript()
327326

328-
res.data = buffer.value.decode('utf-8', errors='ignore')
327+
res.data = buffer.value.decode('utf-8', errors='ignore') # type: ignore
329328
res.error = not success
330329
return res
331330

@@ -636,8 +635,8 @@ def __init__(self, window_id: Optional[int] = None):
636635
self._cb_func_list: dict = {}
637636

638637
# gets used for both filehandler and filehandler_window, should wipe out the other just how it does in C
639-
self._file_handler_cb: _raw.FILE_HANDLER_CB = None
640-
self._buffers = []
638+
self._file_handler_cb: Any = None
639+
self._buffers: list = []
641640

642641
# -- dispatcher for function bindings -----------
643642
def _make_dispatcher(self):
@@ -1431,7 +1430,7 @@ def script(self, script: str, timeout: int = 0, buffer_size: int = 4096) -> Java
14311430
# Initializing Result
14321431
res = JavaScript()
14331432

1434-
res.data = buffer.value.decode('utf-8', errors='ignore')
1433+
res.data = buffer.value.decode('utf-8', errors='ignore') # type: ignore
14351434
res.error = not success
14361435
return res
14371436

0 commit comments

Comments
 (0)