pyloid 0.23.3__tar.gz → 0.23.5__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyloid
3
- Version: 0.23.3
3
+ Version: 0.23.5
4
4
  Summary:
5
5
  Author: aesthetics-of-record
6
6
  Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyloid"
3
- version = "0.23.3"
3
+ version = "0.23.5"
4
4
  description = ""
5
5
  authors = ["aesthetics-of-record <111675679+aesthetics-of-record@users.noreply.github.com>"]
6
6
  readme = "README.md"
@@ -5,4 +5,4 @@ from .tray import TrayEvent
5
5
  from .timer import PyloidTimer
6
6
  from .serve import pyloid_serve
7
7
 
8
- __all__ = ['Pyloid', 'PyloidAPI', 'Bridge', 'get_production_path', 'is_production', 'TrayEvent', 'PyloidTimer', 'serve']
8
+ __all__ = ['Pyloid']
@@ -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 Pyloid
9
+ from ..pyloid import _Pyloid
10
10
 
11
11
 
12
12
  class BaseAPI(PyloidAPI):
13
- def __init__(self, window_id: str, data: dict, app: "Pyloid", rpc_url: Optional[str] = None):
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: "Pyloid" = app
17
+ self.app: "_Pyloid" = app
18
18
  self.rpc_url: Optional[str] = rpc_url
19
19
 
20
20
  @Bridge(result=dict)
@@ -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.web_page.deleteLater()
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()
@@ -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 rpc(self, name: Optional[str] = None) -> Callable:
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__
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes