pyloid 0.11.2__tar.gz → 0.11.4__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.
- {pyloid-0.11.2 → pyloid-0.11.4}/PKG-INFO +2 -2
- {pyloid-0.11.2 → pyloid-0.11.4}/README.md +1 -1
- {pyloid-0.11.2 → pyloid-0.11.4}/pyproject.toml +1 -1
- {pyloid-0.11.2 → pyloid-0.11.4}/src/pyloid/pyloid.py +118 -36
- {pyloid-0.11.2 → pyloid-0.11.4}/LICENSE +0 -0
- {pyloid-0.11.2 → pyloid-0.11.4}/src/pyloid/__init__.py +0 -0
- {pyloid-0.11.2 → pyloid-0.11.4}/src/pyloid/api.py +0 -0
- {pyloid-0.11.2 → pyloid-0.11.4}/src/pyloid/autostart.py +0 -0
- {pyloid-0.11.2 → pyloid-0.11.4}/src/pyloid/filewatcher.py +0 -0
- {pyloid-0.11.2 → pyloid-0.11.4}/src/pyloid/monitor.py +0 -0
- {pyloid-0.11.2 → pyloid-0.11.4}/src/pyloid/timer.py +0 -0
- {pyloid-0.11.2 → pyloid-0.11.4}/src/pyloid/tray.py +0 -0
- {pyloid-0.11.2 → pyloid-0.11.4}/src/pyloid/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyloid
|
3
|
-
Version: 0.11.
|
3
|
+
Version: 0.11.4
|
4
4
|
Summary:
|
5
5
|
Author: aesthetics-of-record
|
6
6
|
Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
|
@@ -48,7 +48,7 @@ With Pyloid, you can leverage the full power of Python in your desktop applicati
|
|
48
48
|
|
49
49
|
#### Creating a React + Vite + Pyloid Project ⚛️
|
50
50
|
|
51
|
-
[https://github.com/pylonic/pyloid_react_boilerplate](https://github.com/Pyloid/
|
51
|
+
[https://github.com/pylonic/pyloid_react_boilerplate](https://github.com/Pyloid/pyloid_react_boilerplate)
|
52
52
|
|
53
53
|
### Custom Your Boilerplate 🔨
|
54
54
|
|
@@ -33,7 +33,7 @@ With Pyloid, you can leverage the full power of Python in your desktop applicati
|
|
33
33
|
|
34
34
|
#### Creating a React + Vite + Pyloid Project ⚛️
|
35
35
|
|
36
|
-
[https://github.com/pylonic/pyloid_react_boilerplate](https://github.com/Pyloid/
|
36
|
+
[https://github.com/pylonic/pyloid_react_boilerplate](https://github.com/Pyloid/pyloid_react_boilerplate)
|
37
37
|
|
38
38
|
### Custom Your Boilerplate 🔨
|
39
39
|
|
@@ -8,7 +8,16 @@ from PySide6.QtWidgets import (
|
|
8
8
|
)
|
9
9
|
from PySide6.QtWebEngineWidgets import QWebEngineView
|
10
10
|
from PySide6.QtWebChannel import QWebChannel
|
11
|
-
from PySide6.QtGui import
|
11
|
+
from PySide6.QtGui import (
|
12
|
+
QIcon,
|
13
|
+
QKeySequence,
|
14
|
+
QShortcut,
|
15
|
+
QClipboard,
|
16
|
+
QImage,
|
17
|
+
QAction,
|
18
|
+
QPalette,
|
19
|
+
QColor,
|
20
|
+
)
|
12
21
|
from PySide6.QtCore import Qt, Signal, QUrl, QObject, QTimer
|
13
22
|
from PySide6.QtNetwork import QLocalServer, QLocalSocket
|
14
23
|
from PySide6.QtWebEngineCore import QWebEnginePage, QWebEngineSettings
|
@@ -23,13 +32,14 @@ import json
|
|
23
32
|
from .autostart import AutoStart
|
24
33
|
from .filewatcher import FileWatcher
|
25
34
|
import logging
|
26
|
-
from PySide6.QtCore import QCoreApplication
|
35
|
+
from PySide6.QtCore import QCoreApplication, QtMsgType
|
27
36
|
|
28
37
|
# for linux debug
|
29
38
|
os.environ["QTWEBENGINE_DICTIONARIES_PATH"] = "/"
|
30
39
|
|
31
40
|
# for macos debug
|
32
|
-
logging.getLogger(
|
41
|
+
logging.getLogger("Qt").setLevel(logging.ERROR)
|
42
|
+
|
33
43
|
|
34
44
|
def custom_message_handler(mode, context, message):
|
35
45
|
if not hasattr(custom_message_handler, "vulkan_warning_shown") and (
|
@@ -42,7 +52,13 @@ def custom_message_handler(mode, context, message):
|
|
42
52
|
)
|
43
53
|
os.environ["QT_QUICK_BACKEND"] = "software"
|
44
54
|
custom_message_handler.vulkan_warning_shown = True
|
45
|
-
|
55
|
+
|
56
|
+
if "Autofill.enable failed" in message:
|
57
|
+
print(
|
58
|
+
"\033[93mPyloid Warning: Autofill is not enabled in developer tools.\033[0m"
|
59
|
+
)
|
60
|
+
|
61
|
+
if "vulkan" not in message.lower() and "Autofill.enable failed" not in message:
|
46
62
|
print(message)
|
47
63
|
|
48
64
|
|
@@ -60,13 +76,12 @@ class WindowAPI(PyloidAPI):
|
|
60
76
|
"""Returns the current window ID."""
|
61
77
|
return self.window_id
|
62
78
|
|
63
|
-
@Bridge(result=
|
79
|
+
@Bridge(result=dict)
|
64
80
|
def getWindowProperties(self):
|
65
81
|
"""Returns the properties of the window."""
|
66
82
|
window = self.app.get_window_by_id(self.window_id)
|
67
|
-
|
68
|
-
|
69
|
-
return None
|
83
|
+
window_properties = window.get_window_properties()
|
84
|
+
return window_properties
|
70
85
|
|
71
86
|
@Bridge()
|
72
87
|
def close(self):
|
@@ -167,6 +182,44 @@ class WindowAPI(PyloidAPI):
|
|
167
182
|
return window.capture(save_path)
|
168
183
|
return None
|
169
184
|
|
185
|
+
@Bridge(result=bool)
|
186
|
+
def getFrame(self):
|
187
|
+
"""Returns whether the window has a frame."""
|
188
|
+
window = self.app.get_window_by_id(self.window_id)
|
189
|
+
return window.frame if window else False
|
190
|
+
|
191
|
+
@Bridge(result=bool)
|
192
|
+
def getContextMenu(self):
|
193
|
+
"""Returns whether the window has a context menu."""
|
194
|
+
window = self.app.get_window_by_id(self.window_id)
|
195
|
+
return window.context_menu if window else False
|
196
|
+
|
197
|
+
@Bridge(result=bool)
|
198
|
+
def getDevTools(self):
|
199
|
+
"""Returns whether the window has developer tools."""
|
200
|
+
window = self.app.get_window_by_id(self.window_id)
|
201
|
+
return window.dev_tools if window else False
|
202
|
+
|
203
|
+
@Bridge(result=str)
|
204
|
+
def getTitle(self):
|
205
|
+
"""Returns the title of the window."""
|
206
|
+
window = self.app.get_window_by_id(self.window_id)
|
207
|
+
return window.title if window else ""
|
208
|
+
|
209
|
+
@Bridge(result=dict)
|
210
|
+
def getSize(self):
|
211
|
+
"""Returns the size of the window."""
|
212
|
+
window = self.app.get_window_by_id(self.window_id)
|
213
|
+
return {"width": window.width, "height": window.height} if window else {"width": 0, "height": 0}
|
214
|
+
|
215
|
+
@Bridge(result=dict)
|
216
|
+
def getPosition(self):
|
217
|
+
"""Returns the position of the window."""
|
218
|
+
window = self.app.get_window_by_id(self.window_id)
|
219
|
+
return {"x": window.x, "y": window.y} if window else {"x": 0, "y": 0}
|
220
|
+
|
221
|
+
|
222
|
+
|
170
223
|
|
171
224
|
# class EventAPI(PylonAPI):
|
172
225
|
# def __init__(self, window_id: str, app):
|
@@ -398,27 +451,21 @@ class BrowserWindow:
|
|
398
451
|
self.dev_tools_window.resize(800, 600)
|
399
452
|
self.dev_tools_window.show()
|
400
453
|
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
"title": self.title,
|
406
|
-
"width": self.width,
|
407
|
-
"height": self.height,
|
408
|
-
"x": self.x,
|
409
|
-
"y": self.y,
|
410
|
-
"frame": self.frame,
|
411
|
-
"context_menu": self.context_menu,
|
412
|
-
"dev_tools": self.dev_tools,
|
413
|
-
"js_apis": self.js_apis,
|
414
|
-
}
|
415
|
-
|
416
|
-
def get_id(self):
|
417
|
-
"""Returns the ID of the window."""
|
418
|
-
return self.id
|
454
|
+
# Add this line to handle dev tools window closure
|
455
|
+
self.dev_tools_window.closeEvent = lambda event: setattr(
|
456
|
+
self, "dev_tools_window", None
|
457
|
+
)
|
419
458
|
|
420
459
|
def closeEvent(self, event):
|
421
460
|
"""Handles the event when the window is closed."""
|
461
|
+
# Close developer tools if open
|
462
|
+
if hasattr(self, "dev_tools_window") and self.dev_tools_window:
|
463
|
+
self.dev_tools_window.close()
|
464
|
+
self.dev_tools_window = None
|
465
|
+
|
466
|
+
# Solve memory leak issue with web view engine
|
467
|
+
self.web_view.page().deleteLater()
|
468
|
+
self.web_view.deleteLater()
|
422
469
|
self._remove_from_app_windows()
|
423
470
|
event.accept() # Accept the event (allow the window to close)
|
424
471
|
|
@@ -558,14 +605,46 @@ class BrowserWindow:
|
|
558
605
|
###########################################################################################
|
559
606
|
# Get Properties
|
560
607
|
###########################################################################################
|
608
|
+
def get_window_properties(self):
|
609
|
+
"""Returns the properties of the window."""
|
610
|
+
return {
|
611
|
+
"id": self.id,
|
612
|
+
"title": self.title,
|
613
|
+
"width": self.width,
|
614
|
+
"height": self.height,
|
615
|
+
"x": self.x,
|
616
|
+
"y": self.y,
|
617
|
+
"frame": self.frame,
|
618
|
+
"context_menu": self.context_menu,
|
619
|
+
"dev_tools": self.dev_tools,
|
620
|
+
}
|
561
621
|
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
622
|
+
def get_id(self):
|
623
|
+
"""Returns the ID of the window."""
|
624
|
+
return self.id
|
625
|
+
|
626
|
+
def get_size(self) -> Dict[str, int]:
|
627
|
+
"""Returns the size of the window."""
|
628
|
+
return {"width": self.width, "height": self.height}
|
629
|
+
|
630
|
+
def get_position(self) -> Dict[str, int]:
|
631
|
+
"""Returns the position of the window."""
|
632
|
+
return {"x": self.x, "y": self.y}
|
633
|
+
|
634
|
+
def get_title(self) -> str:
|
635
|
+
"""Returns the title of the window."""
|
636
|
+
return self.title
|
637
|
+
|
638
|
+
def get_url(self) -> str:
|
639
|
+
"""Returns the URL of the window."""
|
640
|
+
return self.web_view.url().toString()
|
641
|
+
|
642
|
+
def get_visible(self) -> bool:
|
643
|
+
"""Returns the visibility of the window."""
|
644
|
+
return self._window.isVisible()
|
645
|
+
|
646
|
+
|
647
|
+
|
569
648
|
|
570
649
|
|
571
650
|
class _WindowController(QObject):
|
@@ -604,7 +683,7 @@ class Pyloid(QApplication):
|
|
604
683
|
|
605
684
|
self.app_name = app_name
|
606
685
|
self.app_path = sys.executable
|
607
|
-
|
686
|
+
|
608
687
|
self.auto_start = AutoStart(self.app_name, self.app_path)
|
609
688
|
|
610
689
|
self.animation_timer = None
|
@@ -749,8 +828,11 @@ class Pyloid(QApplication):
|
|
749
828
|
window._window.close()
|
750
829
|
|
751
830
|
def quit(self):
|
752
|
-
"""
|
753
|
-
self.
|
831
|
+
"""애플리케이션을 종료합니다."""
|
832
|
+
for window in self.windows:
|
833
|
+
window._window.close()
|
834
|
+
window.web_page.deleteLater()
|
835
|
+
window.web_view.deleteLater()
|
754
836
|
QApplication.quit()
|
755
837
|
|
756
838
|
###########################################################################################
|
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
|