Skip to content

Commit 0587c81

Browse files
committed
reverted function names, misread what was asked. Directory sending-raw is now send_raw_to_javascript.
1 parent 00f870a commit 0587c81

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

PyPI/Package/src/webui/webui.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def close_client(self) -> None:
210210
_raw.webui_close_client(byref(self._c_event()))
211211

212212
# -- send_raw_client ----------------------------
213-
def send_raw_to_javascript_client(self, function: str, data: Union[bytes, bytearray, memoryview, array.array]) -> None:
213+
def send_raw_client(self, function: str, data: Union[bytes, bytearray, memoryview, array.array]) -> None:
214214
"""Safely send raw data to the UI for a single client.
215215
216216
This function sends raw data to a JavaScript function in the UI. The JavaScript function must
@@ -224,7 +224,7 @@ def send_raw_to_javascript_client(self, function: str, data: Union[bytes, bytear
224224
ValueError: If `data` is `None` or empty.
225225
226226
Example:
227-
e.send_raw_to_javascript_client("myJavaScriptFunc", bytearray([0x01, 0x0A, 0xFF]))
227+
e.send_raw_client("myJavaScriptFunc", bytearray([0x01, 0x0A, 0xFF]))
228228
# Sends 3 bytes of raw data to the JavaScript function `myJavaScriptFunc`.
229229
"""
230230
if data is None or len(data) == 0:
@@ -1041,7 +1041,7 @@ def set_icon(self, icon: str, icon_type: str) -> None:
10411041
_raw.webui_set_icon(c_size_t(self._window), icon.encode("utf-8"), icon_type.encode("utf-8"))
10421042

10431043
# -- send_raw -----------------------------------
1044-
def send_raw_to_javascript(self, function: str, data: Union[bytes, bytearray, memoryview, array.array]) -> None:
1044+
def send_raw(self, function: str, data: Union[bytes, bytearray, memoryview, array.array]) -> None:
10451045
"""
10461046
Safely send raw data to the UI for all clients.
10471047
@@ -1059,7 +1059,7 @@ def send_raw_to_javascript(self, function: str, data: Union[bytes, bytearray, me
10591059
None
10601060
10611061
Example:
1062-
my_window.send_raw_to_javascript("myJavaScriptFunc", bytearray([0x01, 0x0A, 0xFF]))
1062+
my_window.send_raw("myJavaScriptFunc", bytearray([0x01, 0x0A, 0xFF]))
10631063
# Sends 3 bytes of raw data to the JavaScript function `myJavaScriptFunc`.
10641064
"""
10651065
if data is None or len(data) == 0:
File renamed without changes.

examples/sending-raw/main.py renamed to examples/send_raw_to_javascript/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def main():
1313

1414
#print(raw_bytes)
1515
# Send over the byte data from the picture to the javascript function we have in the html.
16-
my_window.send_raw_to_javascript("myJavaScriptFunc", raw_bytes)
16+
my_window.send_raw("myJavaScriptFunc", raw_bytes)
1717

1818
# waits for all windows to close before terminating the program.
1919
webui.wait()

0 commit comments

Comments
 (0)