pyloid 0.23.1__tar.gz → 0.23.3__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.1
3
+ Version: 0.23.3
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.1"
3
+ version = "0.23.3"
4
4
  description = ""
5
5
  authors = ["aesthetics-of-record <111675679+aesthetics-of-record@users.noreply.github.com>"]
6
6
  readme = "README.md"
@@ -43,7 +43,7 @@ from PySide6.QtWebEngineCore import (
43
43
  QWebEngineDesktopMediaRequest,
44
44
  )
45
45
 
46
- from .url_interceptor import CustomUrlInterceptor
46
+ # from .url_interceptor import CustomUrlInterceptor
47
47
  from .rpc import PyloidRPC
48
48
 
49
49
  if TYPE_CHECKING:
@@ -323,8 +323,8 @@ class _BrowserWindow:
323
323
  self.rpc_url = None
324
324
 
325
325
  # interceptor ( all url request )
326
- self.interceptor = CustomUrlInterceptor(rpc_url=self.rpc_url)
327
- self.web_view.page().setUrlRequestInterceptor(self.interceptor)
326
+ # self.interceptor = CustomUrlInterceptor(rpc_url=self.rpc_url)
327
+ # self.web_view.page().setUrlRequestInterceptor(self.interceptor)
328
328
 
329
329
  self._window.closeEvent = self.closeEvent # Override closeEvent method
330
330
  ###########################################################################################
@@ -338,7 +338,7 @@ class _BrowserWindow:
338
338
  self.context_menu = context_menu
339
339
  self.dev_tools = dev_tools
340
340
 
341
- self.js_apis = [BaseAPI(self.id, self.app.data, self.app)]
341
+ self.js_apis = [BaseAPI(self.id, self.app.data, self.app, self.rpc_url)]
342
342
 
343
343
  # for js_api in js_apis:
344
344
  # self.js_apis.append(js_api)
@@ -10,11 +10,12 @@ if TYPE_CHECKING:
10
10
 
11
11
 
12
12
  class BaseAPI(PyloidAPI):
13
- def __init__(self, window_id: str, data: dict, app: "Pyloid"):
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
17
  self.app: "Pyloid" = app
18
+ self.rpc_url: Optional[str] = rpc_url
18
19
 
19
20
  @Bridge(result=dict)
20
21
  def getData(self):
@@ -37,7 +38,7 @@ class BaseAPI(PyloidAPI):
37
38
  def getWindowProperties(self):
38
39
  """Returns the properties of the window."""
39
40
  window = self.app.get_window_by_id(self.window_id)
40
- window_properties = window.get_window_properties()
41
+ window_properties = window._window.get_window_properties()
41
42
  return window_properties
42
43
 
43
44
  @Bridge()
@@ -45,136 +46,136 @@ class BaseAPI(PyloidAPI):
45
46
  """Closes the window."""
46
47
  window = self.app.get_window_by_id(self.window_id)
47
48
  if window:
48
- window.close()
49
+ window._window.close()
49
50
 
50
51
  @Bridge()
51
52
  def hide(self):
52
53
  """Hides the window."""
53
54
  window = self.app.get_window_by_id(self.window_id)
54
55
  if window:
55
- window.hide()
56
+ window._window.hide()
56
57
 
57
58
  @Bridge()
58
59
  def show(self):
59
60
  """Shows and focuses the window."""
60
61
  window = self.app.get_window_by_id(self.window_id)
61
62
  if window:
62
- window.show()
63
+ window._window.show()
63
64
 
64
65
  @Bridge()
65
66
  def focus(self):
66
67
  """Focuses the window."""
67
68
  window = self.app.get_window_by_id(self.window_id)
68
69
  if window:
69
- window.focus()
70
+ window._window.focus()
70
71
 
71
72
  @Bridge()
72
73
  def showAndFocus(self):
73
74
  """Shows and focuses the window."""
74
75
  window = self.app.get_window_by_id(self.window_id)
75
76
  if window:
76
- window.show_and_focus()
77
+ window._window.show_and_focus()
77
78
 
78
79
  @Bridge()
79
80
  def fullscreen(self):
80
81
  """Enters fullscreen mode."""
81
82
  window = self.app.get_window_by_id(self.window_id)
82
83
  if window:
83
- window.fullscreen()
84
+ window._window.fullscreen()
84
85
 
85
86
  @Bridge()
86
87
  def toggleFullscreen(self):
87
88
  """Toggles fullscreen mode for the window."""
88
89
  window = self.app.get_window_by_id(self.window_id)
89
90
  if window:
90
- window.toggle_fullscreen()
91
+ window._window.toggle_fullscreen()
91
92
 
92
93
  @Bridge()
93
94
  def minimize(self):
94
95
  """Minimizes the window."""
95
96
  window = self.app.get_window_by_id(self.window_id)
96
97
  if window:
97
- window.minimize()
98
+ window._window.minimize()
98
99
 
99
100
  @Bridge()
100
101
  def maximize(self):
101
102
  """Maximizes the window."""
102
103
  window = self.app.get_window_by_id(self.window_id)
103
104
  if window:
104
- window.maximize()
105
+ window._window.maximize()
105
106
 
106
107
  @Bridge()
107
108
  def unmaximize(self):
108
109
  """Restores the window to its normal state."""
109
110
  window = self.app.get_window_by_id(self.window_id)
110
111
  if window:
111
- window.unmaximize()
112
+ window._window.unmaximize()
112
113
 
113
114
  @Bridge()
114
115
  def toggleMaximize(self):
115
116
  """Toggles the maximized state of the window."""
116
117
  window = self.app.get_window_by_id(self.window_id)
117
118
  if window:
118
- window.toggle_maximize()
119
+ window._window.toggle_maximize()
119
120
 
120
121
  @Bridge(result=bool)
121
122
  def isFullscreen(self):
122
123
  """Returns True if the window is fullscreen."""
123
124
  window = self.app.get_window_by_id(self.window_id)
124
- return window.is_fullscreen()
125
+ return window._window.is_fullscreen()
125
126
 
126
127
  @Bridge(result=bool)
127
128
  def isMaximized(self):
128
129
  """Returns True if the window is maximized."""
129
130
  window = self.app.get_window_by_id(self.window_id)
130
- return window.is_maximized()
131
+ return window._window.is_maximized()
131
132
 
132
133
  @Bridge(str)
133
134
  def setTitle(self, title: str):
134
135
  """Sets the title of the window."""
135
136
  window = self.app.get_window_by_id(self.window_id)
136
137
  if window:
137
- window.set_title(title)
138
+ window._window.set_title(title)
138
139
 
139
140
  @Bridge(int, int)
140
141
  def setSize(self, width: int, height: int):
141
142
  """Sets the size of the window."""
142
143
  window = self.app.get_window_by_id(self.window_id)
143
144
  if window:
144
- window.set_size(width, height)
145
+ window._window.set_size(width, height)
145
146
 
146
147
  @Bridge(int, int)
147
148
  def setPosition(self, x: int, y: int):
148
149
  """Sets the position of the window."""
149
150
  window = self.app.get_window_by_id(self.window_id)
150
151
  if window:
151
- window.set_position(x, y)
152
+ window._window.set_position(x, y)
152
153
 
153
154
  @Bridge(bool)
154
155
  def setFrame(self, frame: bool):
155
156
  """Sets the frame of the window."""
156
157
  window = self.app.get_window_by_id(self.window_id)
157
158
  if window:
158
- window.set_frame(frame)
159
+ window._window.set_frame(frame)
159
160
 
160
161
  @Bridge(result=bool)
161
162
  def getFrame(self):
162
163
  """Returns whether the window has a frame."""
163
164
  window = self.app.get_window_by_id(self.window_id)
164
- return window.frame if window else False
165
+ return window._window.frame if window else False
165
166
 
166
167
  @Bridge(result=str)
167
168
  def getTitle(self):
168
169
  """Returns the title of the window."""
169
170
  window = self.app.get_window_by_id(self.window_id)
170
- return window.title if window else ""
171
+ return window._window.title if window else ""
171
172
 
172
173
  @Bridge(result=dict)
173
174
  def getSize(self):
174
175
  """Returns the size of the window."""
175
176
  window = self.app.get_window_by_id(self.window_id)
176
177
  return (
177
- {"width": window.width, "height": window.height}
178
+ {"width": window._window.width, "height": window._window.height}
178
179
  if window
179
180
  else {"width": 0, "height": 0}
180
181
  )
@@ -183,7 +184,7 @@ class BaseAPI(PyloidAPI):
183
184
  def getPosition(self):
184
185
  """Returns the position of the window."""
185
186
  window = self.app.get_window_by_id(self.window_id)
186
- return {"x": window.x, "y": window.y} if window else {"x": 0, "y": 0}
187
+ return {"x": window._window.x, "y": window._window.y} if window else {"x": 0, "y": 0}
187
188
 
188
189
  ###############################################################
189
190
  # Clipboard
@@ -252,4 +253,9 @@ class BaseAPI(PyloidAPI):
252
253
  """Returns the production path of the application."""
253
254
  return get_production_path(path)
254
255
 
256
+ @Bridge(result=str)
257
+ def getRpcUrl(self):
258
+ """Returns the RPC URL of the application."""
259
+ return self.rpc_url
260
+
255
261
 
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
File without changes
File without changes
File without changes