pyloid 0.23.0__py3-none-any.whl → 0.23.2__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 CHANGED
@@ -566,14 +566,17 @@ class _BrowserWindow:
566
566
  console.error('QWebChannel is not defined.');
567
567
  }
568
568
  """
569
- js_api_init = "\n".join(
570
- [
571
- f"window['{js_api.__class__.__name__}'] = channel.objects['{js_api.__class__.__name__}'];\n"
572
- # f"console.log('{js_api.__class__.__name__} object initialized:', window.pyloid['{js_api.__class__.__name__}']);"
573
- for js_api in self.js_apis
574
- ]
575
- )
576
- self.web_view.page().runJavaScript(js_code % js_api_init)
569
+ # js_api_init = "\n".join(
570
+ # [
571
+ # f"window['{js_api.__class__.__name__}'] = channel.objects['{js_api.__class__.__name__}'];\n"
572
+ # f"console.log('{js_api.__class__.__name__} object initialized:', window.pyloid['{js_api.__class__.__name__}']);"
573
+ # for js_api in self.js_apis
574
+ # ]
575
+ # )
576
+
577
+ base_api_init = "window['__PYLOID__'] = channel.objects['__PYLOID__'];\n"
578
+
579
+ self.web_view.page().runJavaScript(js_code % base_api_init)
577
580
 
578
581
  # if splash screen is set, close it when the page is loaded
579
582
  if self.close_on_load and self.splash_screen:
pyloid/js_api/base.py CHANGED
@@ -37,7 +37,7 @@ class BaseAPI(PyloidAPI):
37
37
  def getWindowProperties(self):
38
38
  """Returns the properties of the window."""
39
39
  window = self.app.get_window_by_id(self.window_id)
40
- window_properties = window.get_window_properties()
40
+ window_properties = window._window.get_window_properties()
41
41
  return window_properties
42
42
 
43
43
  @Bridge()
@@ -45,136 +45,136 @@ class BaseAPI(PyloidAPI):
45
45
  """Closes the window."""
46
46
  window = self.app.get_window_by_id(self.window_id)
47
47
  if window:
48
- window.close()
48
+ window._window.close()
49
49
 
50
50
  @Bridge()
51
51
  def hide(self):
52
52
  """Hides the window."""
53
53
  window = self.app.get_window_by_id(self.window_id)
54
54
  if window:
55
- window.hide()
55
+ window._window.hide()
56
56
 
57
57
  @Bridge()
58
58
  def show(self):
59
59
  """Shows and focuses the window."""
60
60
  window = self.app.get_window_by_id(self.window_id)
61
61
  if window:
62
- window.show()
62
+ window._window.show()
63
63
 
64
64
  @Bridge()
65
65
  def focus(self):
66
66
  """Focuses the window."""
67
67
  window = self.app.get_window_by_id(self.window_id)
68
68
  if window:
69
- window.focus()
69
+ window._window.focus()
70
70
 
71
71
  @Bridge()
72
72
  def showAndFocus(self):
73
73
  """Shows and focuses the window."""
74
74
  window = self.app.get_window_by_id(self.window_id)
75
75
  if window:
76
- window.show_and_focus()
76
+ window._window.show_and_focus()
77
77
 
78
78
  @Bridge()
79
79
  def fullscreen(self):
80
80
  """Enters fullscreen mode."""
81
81
  window = self.app.get_window_by_id(self.window_id)
82
82
  if window:
83
- window.fullscreen()
83
+ window._window.fullscreen()
84
84
 
85
85
  @Bridge()
86
86
  def toggleFullscreen(self):
87
87
  """Toggles fullscreen mode for the window."""
88
88
  window = self.app.get_window_by_id(self.window_id)
89
89
  if window:
90
- window.toggle_fullscreen()
90
+ window._window.toggle_fullscreen()
91
91
 
92
92
  @Bridge()
93
93
  def minimize(self):
94
94
  """Minimizes the window."""
95
95
  window = self.app.get_window_by_id(self.window_id)
96
96
  if window:
97
- window.minimize()
97
+ window._window.minimize()
98
98
 
99
99
  @Bridge()
100
100
  def maximize(self):
101
101
  """Maximizes the window."""
102
102
  window = self.app.get_window_by_id(self.window_id)
103
103
  if window:
104
- window.maximize()
104
+ window._window.maximize()
105
105
 
106
106
  @Bridge()
107
107
  def unmaximize(self):
108
108
  """Restores the window to its normal state."""
109
109
  window = self.app.get_window_by_id(self.window_id)
110
110
  if window:
111
- window.unmaximize()
111
+ window._window.unmaximize()
112
112
 
113
113
  @Bridge()
114
114
  def toggleMaximize(self):
115
115
  """Toggles the maximized state of the window."""
116
116
  window = self.app.get_window_by_id(self.window_id)
117
117
  if window:
118
- window.toggle_maximize()
118
+ window._window.toggle_maximize()
119
119
 
120
120
  @Bridge(result=bool)
121
121
  def isFullscreen(self):
122
122
  """Returns True if the window is fullscreen."""
123
123
  window = self.app.get_window_by_id(self.window_id)
124
- return window.is_fullscreen()
124
+ return window._window.is_fullscreen()
125
125
 
126
126
  @Bridge(result=bool)
127
127
  def isMaximized(self):
128
128
  """Returns True if the window is maximized."""
129
129
  window = self.app.get_window_by_id(self.window_id)
130
- return window.is_maximized()
130
+ return window._window.is_maximized()
131
131
 
132
132
  @Bridge(str)
133
133
  def setTitle(self, title: str):
134
134
  """Sets the title of the window."""
135
135
  window = self.app.get_window_by_id(self.window_id)
136
136
  if window:
137
- window.set_title(title)
137
+ window._window.set_title(title)
138
138
 
139
139
  @Bridge(int, int)
140
140
  def setSize(self, width: int, height: int):
141
141
  """Sets the size of the window."""
142
142
  window = self.app.get_window_by_id(self.window_id)
143
143
  if window:
144
- window.set_size(width, height)
144
+ window._window.set_size(width, height)
145
145
 
146
146
  @Bridge(int, int)
147
147
  def setPosition(self, x: int, y: int):
148
148
  """Sets the position of the window."""
149
149
  window = self.app.get_window_by_id(self.window_id)
150
150
  if window:
151
- window.set_position(x, y)
151
+ window._window.set_position(x, y)
152
152
 
153
153
  @Bridge(bool)
154
154
  def setFrame(self, frame: bool):
155
155
  """Sets the frame of the window."""
156
156
  window = self.app.get_window_by_id(self.window_id)
157
157
  if window:
158
- window.set_frame(frame)
158
+ window._window.set_frame(frame)
159
159
 
160
160
  @Bridge(result=bool)
161
161
  def getFrame(self):
162
162
  """Returns whether the window has a frame."""
163
163
  window = self.app.get_window_by_id(self.window_id)
164
- return window.frame if window else False
164
+ return window._window.frame if window else False
165
165
 
166
166
  @Bridge(result=str)
167
167
  def getTitle(self):
168
168
  """Returns the title of the window."""
169
169
  window = self.app.get_window_by_id(self.window_id)
170
- return window.title if window else ""
170
+ return window._window.title if window else ""
171
171
 
172
172
  @Bridge(result=dict)
173
173
  def getSize(self):
174
174
  """Returns the size of the window."""
175
175
  window = self.app.get_window_by_id(self.window_id)
176
176
  return (
177
- {"width": window.width, "height": window.height}
177
+ {"width": window._window.width, "height": window._window.height}
178
178
  if window
179
179
  else {"width": 0, "height": 0}
180
180
  )
@@ -183,7 +183,7 @@ class BaseAPI(PyloidAPI):
183
183
  def getPosition(self):
184
184
  """Returns the position of the window."""
185
185
  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}
186
+ return {"x": window._window.x, "y": window._window.y} if window else {"x": 0, "y": 0}
187
187
 
188
188
  ###############################################################
189
189
  # Clipboard
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyloid
3
- Version: 0.23.0
3
+ Version: 0.23.2
4
4
  Summary:
5
5
  Author: aesthetics-of-record
6
6
  Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
@@ -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=mQhdMOK7iHSer_rgewDuxEXXF4CrNs4TVt-OQ7YJDTs,99591
4
+ pyloid/browser_window.py,sha256=Bf0rtdOsZb6fM55xQkDQQfdDATashnVlRYvGPM93X0M,99696
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=T7znBDwUwGduHEt--F6eKQwdXPcJsMrMjBs7Z1XVrPE,8255
7
+ pyloid/js_api/base.py,sha256=_uvHN0lvczMNswXOWRQd8xZCxpkSXaaiKSVFRAseIsw,8447
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.0.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
21
- pyloid-0.23.0.dist-info/METADATA,sha256=jkOxOCerLMGqkVGHmye1m8v-TOSugHqxYycC3C3rTHU,3197
22
- pyloid-0.23.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
23
- pyloid-0.23.0.dist-info/RECORD,,
20
+ pyloid-0.23.2.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
21
+ pyloid-0.23.2.dist-info/METADATA,sha256=K_g2F_Ogn0dHa5ZWK6x0AXEm0Nwva70SPmCFUSSH-rI,3197
22
+ pyloid-0.23.2.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
23
+ pyloid-0.23.2.dist-info/RECORD,,