Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PyPI/Package/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Typing :: Typed",
]

[project.urls]
Expand Down
4 changes: 2 additions & 2 deletions PyPI/Package/src/webui/load_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _download_library():


# Load WebUI Dynamic Library
def load_library() -> CDLL:
def load_library() -> CDLL | None:
library: CDLL | None = None
lib_path = _get_library_path()
if not os.path.exists(lib_path):
Expand Down Expand Up @@ -87,4 +87,4 @@ def load_library() -> CDLL:
else:
print("Unsupported OS")

return library
return library
1 change: 1 addition & 0 deletions PyPI/Package/src/webui/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

13 changes: 6 additions & 7 deletions PyPI/Package/src/webui/webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
from __future__ import annotations

import warnings
from typing import Callable, Optional
from typing import Any, Callable, Optional, TypeAlias
from ctypes import *

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



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

Expand Down Expand Up @@ -308,7 +307,7 @@ def script_client(self, script: str, timeout: int = 0, buffer_size: int = 4096)
# Initializing Result
res = JavaScript()

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

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

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

# -- dispatcher for function bindings -----------
def _make_dispatcher(self):
Expand Down Expand Up @@ -1051,7 +1050,7 @@ def send_raw(self, function: str, raw: Optional[c_void_p], size: int) -> None:
_raw.webui_send_raw(
c_size_t(self._window),
c_char_p(function.encode("utf-8")),
c_void_p(raw),
c_void_p(raw), # type: ignore
c_size_t(size)
)

Expand Down Expand Up @@ -1397,7 +1396,7 @@ def script(self, script: str, timeout: int = 0, buffer_size: int = 4096) -> Java
# Initializing Result
res = JavaScript()

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

Expand Down