pyloid 0.23.1__py3-none-any.whl → 0.23.3__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/browser_window.py +4 -4
- pyloid/js_api/base.py +29 -23
- {pyloid-0.23.1.dist-info → pyloid-0.23.3.dist-info}/METADATA +1 -1
- {pyloid-0.23.1.dist-info → pyloid-0.23.3.dist-info}/RECORD +6 -6
- {pyloid-0.23.1.dist-info → pyloid-0.23.3.dist-info}/LICENSE +0 -0
- {pyloid-0.23.1.dist-info → pyloid-0.23.3.dist-info}/WHEEL +0 -0
pyloid/browser_window.py
CHANGED
@@ -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)
|
pyloid/js_api/base.py
CHANGED
@@ -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
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
pyloid/__init__.py,sha256=4xh7DHBMw2ciDFwI376xcIArhH8GaM4K_NdIa3N0BFo,335
|
2
2
|
pyloid/api.py,sha256=A61Kmddh8BlpT3LfA6NbPQNzFmD95vQ4WKX53oKsGYU,2419
|
3
3
|
pyloid/autostart.py,sha256=K7DQYl4LHItvPp0bt1V9WwaaZmVSTeGvadkcwG-KKrI,3899
|
4
|
-
pyloid/browser_window.py,sha256=
|
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=_gBj_Sn55JfaFSi_eEH0tGdAlqQvBoIAUsiSzVlPTaw,8666
|
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
|
@@ -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.3.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
|
21
|
+
pyloid-0.23.3.dist-info/METADATA,sha256=q0BitAdqUaO5Xp6KuynFaI0HtLjR12oO8l26VpvRPkY,3197
|
22
|
+
pyloid-0.23.3.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
23
|
+
pyloid-0.23.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|