pyloid 0.23.3__py3-none-any.whl → 0.23.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyloid/__init__.py +1 -1
- pyloid/js_api/base.py +3 -3
- pyloid/pyloid.py +2 -2
- pyloid/rpc.py +25 -1
- {pyloid-0.23.3.dist-info → pyloid-0.23.5.dist-info}/METADATA +1 -1
- {pyloid-0.23.3.dist-info → pyloid-0.23.5.dist-info}/RECORD +8 -8
- {pyloid-0.23.3.dist-info → pyloid-0.23.5.dist-info}/LICENSE +0 -0
- {pyloid-0.23.3.dist-info → pyloid-0.23.5.dist-info}/WHEEL +0 -0
pyloid/__init__.py
CHANGED
pyloid/js_api/base.py
CHANGED
@@ -6,15 +6,15 @@ import base64
|
|
6
6
|
from ..utils import get_platform, is_production, get_production_path
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
-
from ..pyloid import
|
9
|
+
from ..pyloid import _Pyloid
|
10
10
|
|
11
11
|
|
12
12
|
class BaseAPI(PyloidAPI):
|
13
|
-
def __init__(self, window_id: str, data: dict, app: "
|
13
|
+
def __init__(self, window_id: str, data: dict, app: "_Pyloid", rpc_url: Optional[str] = None):
|
14
14
|
super().__init__()
|
15
15
|
self.window_id: str = window_id
|
16
16
|
self.data: dict = data
|
17
|
-
self.app: "
|
17
|
+
self.app: "_Pyloid" = app
|
18
18
|
self.rpc_url: Optional[str] = rpc_url
|
19
19
|
|
20
20
|
@Bridge(result=dict)
|
pyloid/pyloid.py
CHANGED
@@ -485,8 +485,8 @@ class _Pyloid(QApplication):
|
|
485
485
|
|
486
486
|
for window in self.windows_dict.values():
|
487
487
|
window._window.close()
|
488
|
-
window.
|
489
|
-
window.web_view.deleteLater()
|
488
|
+
# window._window.web_view.page().deleteLater()
|
489
|
+
# window._window.web_view.deleteLater()
|
490
490
|
|
491
491
|
self.windows_dict.clear()
|
492
492
|
QApplication.quit()
|
pyloid/rpc.py
CHANGED
@@ -87,6 +87,18 @@ class PyloidRPC:
|
|
87
87
|
def __init__(self):
|
88
88
|
"""
|
89
89
|
Initialize the PyloidRPC server instance.
|
90
|
+
|
91
|
+
Examples
|
92
|
+
--------
|
93
|
+
```python
|
94
|
+
from pyloid.rpc import PyloidRPC
|
95
|
+
|
96
|
+
rpc = PyloidRPC()
|
97
|
+
|
98
|
+
@rpc.method()
|
99
|
+
async def add(a: int, b: int) -> int:
|
100
|
+
return a + b
|
101
|
+
```
|
90
102
|
"""
|
91
103
|
self._host = "127.0.0.1"
|
92
104
|
self._port = get_free_port()
|
@@ -115,7 +127,7 @@ class PyloidRPC:
|
|
115
127
|
self._runner: Optional[web.AppRunner] = None
|
116
128
|
self._site: Optional[web.TCPSite] = None
|
117
129
|
|
118
|
-
def
|
130
|
+
def method(self, name: Optional[str] = None) -> Callable:
|
119
131
|
"""
|
120
132
|
Decorator to register an async function as an RPC method.
|
121
133
|
|
@@ -136,6 +148,18 @@ class PyloidRPC:
|
|
136
148
|
If the decorated function is not an async function (`coroutinefunction`).
|
137
149
|
ValueError
|
138
150
|
If an RPC function with the specified name is already registered.
|
151
|
+
|
152
|
+
Examples
|
153
|
+
--------
|
154
|
+
```python
|
155
|
+
from pyloid.rpc import PyloidRPC
|
156
|
+
|
157
|
+
rpc = PyloidRPC()
|
158
|
+
|
159
|
+
@rpc.method()
|
160
|
+
async def add(a: int, b: int) -> int:
|
161
|
+
return a + b
|
162
|
+
```
|
139
163
|
"""
|
140
164
|
def decorator(func: Callable[..., Coroutine[Any, Any, Any]]):
|
141
165
|
rpc_name = name or func.__name__
|
@@ -1,15 +1,15 @@
|
|
1
|
-
pyloid/__init__.py,sha256=
|
1
|
+
pyloid/__init__.py,sha256=YKwMCSOds1QVi9N7EGfY0Z7BEjJn8j6HGqRblZlZClA,235
|
2
2
|
pyloid/api.py,sha256=A61Kmddh8BlpT3LfA6NbPQNzFmD95vQ4WKX53oKsGYU,2419
|
3
3
|
pyloid/autostart.py,sha256=K7DQYl4LHItvPp0bt1V9WwaaZmVSTeGvadkcwG-KKrI,3899
|
4
4
|
pyloid/browser_window.py,sha256=XCbFjVNdc5SfsvGeo1M6roC-9P6CG7gp6nAbNXvaKWE,99716
|
5
5
|
pyloid/custom/titlebar.py,sha256=itzK9pJbZMQ7BKca9kdbuHMffurrw15UijR6OU03Xsk,3894
|
6
6
|
pyloid/filewatcher.py,sha256=3M5zWVUf1OhlkWJcDFC8ZA9agO4Q-U8WdgGpy6kaVz0,4601
|
7
|
-
pyloid/js_api/base.py,sha256=
|
7
|
+
pyloid/js_api/base.py,sha256=XD3sqWYAb1nw6VgY3xXsU4ls5xLGrxpOqmLRJm_vBso,8669
|
8
8
|
pyloid/js_api/event_api.py,sha256=w0z1DcmwcmseqfcoZWgsQmFC2iBCgTMVJubTaHeXI1c,957
|
9
9
|
pyloid/js_api/window_api.py,sha256=-isphU3m2wGB5U0yZrSuK_4XiBz2mG45HsjYTUq7Fxs,7348
|
10
10
|
pyloid/monitor.py,sha256=1mXvHm5deohnNlTLcRx4sT4x-stnOIb0dUQnnxN50Uo,28295
|
11
|
-
pyloid/pyloid.py,sha256=
|
12
|
-
pyloid/rpc.py,sha256=
|
11
|
+
pyloid/pyloid.py,sha256=yWZ6wJjdKaDPz3k80fa9quFqLhzV4asyy4mDKGVEt-M,85593
|
12
|
+
pyloid/rpc.py,sha256=V7iPdKPHpsG6LOgXTSIshYTR-dkLXWHoQchB_7DvwKY,15648
|
13
13
|
pyloid/serve.py,sha256=wJIBqiLr1-8FvBdV3yybeBtVXsu94FfWYKjHL0eQ68s,1444
|
14
14
|
pyloid/store.py,sha256=p0plJj52hQjjtNMVJhy20eNLXfQ3Qmf7LtGHQk7FiPg,4471
|
15
15
|
pyloid/thread_pool.py,sha256=fKOBb8jMfZn_7crA_fJCno8dObBRZE31EIWaNQ759aw,14616
|
@@ -17,7 +17,7 @@ pyloid/timer.py,sha256=RqMsChFUd93cxMVgkHWiIKrci0QDTBgJSTULnAtYT8M,8712
|
|
17
17
|
pyloid/tray.py,sha256=D12opVEc2wc2T4tK9epaN1oOdeziScsIVNM2uCN7C-A,1710
|
18
18
|
pyloid/url_interceptor.py,sha256=AFjPANDELc9-E-1TnVvkNVc-JZBJYf0677dWQ8LDaqw,726
|
19
19
|
pyloid/utils.py,sha256=e866N9uyAGHTMYsqRYY4JL0AEMRCOiY-k1c1zmEpDA4,4686
|
20
|
-
pyloid-0.23.
|
21
|
-
pyloid-0.23.
|
22
|
-
pyloid-0.23.
|
23
|
-
pyloid-0.23.
|
20
|
+
pyloid-0.23.5.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
|
21
|
+
pyloid-0.23.5.dist-info/METADATA,sha256=skLbKVTmPVd0d5QKBO78SPLH6Xmt7dWCgjH4Y49XpcM,3197
|
22
|
+
pyloid-0.23.5.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
23
|
+
pyloid-0.23.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|