pyloid 0.17.3__py3-none-any.whl → 0.18.0__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/api.py +8 -0
- pyloid/browser_window.py +10 -5
- pyloid/js_api/window_api.py +4 -4
- pyloid/utils.py +3 -2
- {pyloid-0.17.3.dist-info → pyloid-0.18.0.dist-info}/METADATA +3 -3
- {pyloid-0.17.3.dist-info → pyloid-0.18.0.dist-info}/RECORD +8 -8
- {pyloid-0.17.3.dist-info → pyloid-0.18.0.dist-info}/LICENSE +0 -0
- {pyloid-0.17.3.dist-info → pyloid-0.18.0.dist-info}/WHEEL +0 -0
pyloid/api.py
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
from PySide6.QtCore import QObject, Slot
|
2
|
+
from typing import TYPE_CHECKING
|
3
|
+
|
4
|
+
if TYPE_CHECKING:
|
5
|
+
from pyloid.pyloid import Pyloid
|
6
|
+
from pyloid.browser_window import BrowserWindow
|
2
7
|
|
3
8
|
|
4
9
|
class PyloidAPI(QObject):
|
@@ -45,6 +50,9 @@ class PyloidAPI(QObject):
|
|
45
50
|
|
46
51
|
def __init__(self):
|
47
52
|
super().__init__()
|
53
|
+
self.window_id: str = None
|
54
|
+
self.window: "BrowserWindow" = None
|
55
|
+
self.app: "Pyloid" = None
|
48
56
|
|
49
57
|
|
50
58
|
def Bridge(*args, **kwargs):
|
pyloid/browser_window.py
CHANGED
@@ -72,7 +72,7 @@ class CustomWebEngineView(QWebEngineView):
|
|
72
72
|
super().__init__(parent._window)
|
73
73
|
self.parent: "BrowserWindow" = parent
|
74
74
|
|
75
|
-
#
|
75
|
+
# Custom Web Page
|
76
76
|
self.custom_page = CustomWebPage()
|
77
77
|
self.setPage(self.custom_page)
|
78
78
|
|
@@ -97,7 +97,7 @@ class CustomWebEngineView(QWebEngineView):
|
|
97
97
|
self.resize_start_pos = event.globalPos()
|
98
98
|
|
99
99
|
def start_system_drag(self):
|
100
|
-
"""
|
100
|
+
"""Start system window move"""
|
101
101
|
if self.parent._window.windowHandle():
|
102
102
|
self.parent._window.windowHandle().startSystemMove()
|
103
103
|
|
@@ -105,7 +105,7 @@ class CustomWebEngineView(QWebEngineView):
|
|
105
105
|
if self.parent.frame or not self.is_resizing_enabled:
|
106
106
|
return
|
107
107
|
|
108
|
-
#
|
108
|
+
# Check resize direction
|
109
109
|
was_in_resize_area = self.is_in_resize_area
|
110
110
|
resize_direction = self.get_resize_direction(event.pos())
|
111
111
|
self.is_in_resize_area = bool(resize_direction)
|
@@ -117,7 +117,7 @@ class CustomWebEngineView(QWebEngineView):
|
|
117
117
|
self.resize_window(event.globalPos())
|
118
118
|
return
|
119
119
|
|
120
|
-
#
|
120
|
+
# Change cursor when entering/leaving resize area
|
121
121
|
if self.is_in_resize_area != was_in_resize_area:
|
122
122
|
if self.is_in_resize_area:
|
123
123
|
# self.setAttribute(Qt.WA_SetCursor, True)
|
@@ -239,7 +239,7 @@ class BrowserWindow:
|
|
239
239
|
self.frame = frame
|
240
240
|
self.context_menu = context_menu
|
241
241
|
self.dev_tools = dev_tools
|
242
|
-
self.js_apis = [WindowAPI(
|
242
|
+
self.js_apis = [WindowAPI()]
|
243
243
|
for js_api in js_apis:
|
244
244
|
self.js_apis.append(js_api)
|
245
245
|
self.shortcuts = {}
|
@@ -374,6 +374,11 @@ class BrowserWindow:
|
|
374
374
|
# Register additional JS APIs
|
375
375
|
if self.js_apis:
|
376
376
|
for js_api in self.js_apis:
|
377
|
+
# Define window_id, window, and app for each JS API
|
378
|
+
js_api.window_id = self.id
|
379
|
+
js_api.window = self
|
380
|
+
js_api.app = self.app
|
381
|
+
|
377
382
|
self.channel.registerObject(js_api.__class__.__name__, js_api)
|
378
383
|
|
379
384
|
self.web_view.page().setWebChannel(self.channel)
|
pyloid/js_api/window_api.py
CHANGED
@@ -8,10 +8,10 @@ if TYPE_CHECKING:
|
|
8
8
|
from ..pyloid import Pyloid
|
9
9
|
|
10
10
|
class WindowAPI(PyloidAPI):
|
11
|
-
def __init__(self, window_id: str, app: 'Pyloid'):
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
# def __init__(self, window_id: str, app: 'Pyloid'):
|
12
|
+
# super().__init__()
|
13
|
+
# self.window_id: str = window_id
|
14
|
+
# self.app: 'Pyloid' = app
|
15
15
|
|
16
16
|
@Bridge(result=str)
|
17
17
|
def getWindowId(self):
|
pyloid/utils.py
CHANGED
@@ -25,8 +25,9 @@ def get_production_path(path: Optional[str] = None) -> Optional[str]:
|
|
25
25
|
>>> print("Not in a production environment.")
|
26
26
|
"""
|
27
27
|
if getattr(sys, 'frozen', False):
|
28
|
-
#
|
29
|
-
|
28
|
+
# Nuitka
|
29
|
+
base_path = os.path.dirname(sys.executable)
|
30
|
+
return os.path.join(base_path, path) if path else base_path
|
30
31
|
else:
|
31
32
|
# If running as a regular Python script
|
32
33
|
return None
|
@@ -1,16 +1,16 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyloid
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.18.0
|
4
4
|
Summary:
|
5
5
|
Author: aesthetics-of-record
|
6
6
|
Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
|
7
|
-
Requires-Python: >=3.9,<3.
|
7
|
+
Requires-Python: >=3.9,<3.14
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
9
9
|
Classifier: Programming Language :: Python :: 3.9
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
13
|
-
Requires-Dist: pyside6 (>=6.8.
|
13
|
+
Requires-Dist: pyside6 (>=6.8.1,<7.0.0)
|
14
14
|
Description-Content-Type: text/markdown
|
15
15
|
|
16
16
|
# Pyloid 👋
|
@@ -1,18 +1,18 @@
|
|
1
1
|
pyloid/__init__.py,sha256=OOPhOKNQVmAM8hnfTeE7lHzxb8LsFNcgegBAvDrA-vY,293
|
2
|
-
pyloid/api.py,sha256=
|
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=6Es-DH45URUV6rlCBWj3ZWwrXLMUvqp5700WlU8Sdwo,62984
|
5
5
|
pyloid/custom/titlebar.py,sha256=itzK9pJbZMQ7BKca9kdbuHMffurrw15UijR6OU03Xsk,3894
|
6
6
|
pyloid/filewatcher.py,sha256=3M5zWVUf1OhlkWJcDFC8ZA9agO4Q-U8WdgGpy6kaVz0,4601
|
7
7
|
pyloid/js_api/event_api.py,sha256=_52yyBonqecmMvJpFW7OMNi_jX8Nrteqw_kI6r-DGG0,951
|
8
|
-
pyloid/js_api/window_api.py,sha256=
|
8
|
+
pyloid/js_api/window_api.py,sha256=BsAO4VBkqfUPib4f7AHxaMRXvN3FvzMXDBsqSUAay3c,8489
|
9
9
|
pyloid/monitor.py,sha256=1mXvHm5deohnNlTLcRx4sT4x-stnOIb0dUQnnxN50Uo,28295
|
10
10
|
pyloid/pyloid.py,sha256=YKE2a5yZFbBZrtMND2X5I7CVnFRK40NFzDp3kYN-oQg,44091
|
11
11
|
pyloid/thread_pool.py,sha256=fKOBb8jMfZn_7crA_fJCno8dObBRZE31EIWaNQ759aw,14616
|
12
12
|
pyloid/timer.py,sha256=RqMsChFUd93cxMVgkHWiIKrci0QDTBgJSTULnAtYT8M,8712
|
13
13
|
pyloid/tray.py,sha256=D12opVEc2wc2T4tK9epaN1oOdeziScsIVNM2uCN7C-A,1710
|
14
|
-
pyloid/utils.py,sha256=
|
15
|
-
pyloid-0.
|
16
|
-
pyloid-0.
|
17
|
-
pyloid-0.
|
18
|
-
pyloid-0.
|
14
|
+
pyloid/utils.py,sha256=rXxh28sWXkA3JGN5LxsXR5Ruhz2l10MNi5X_BViLO_Q,2655
|
15
|
+
pyloid-0.18.0.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
|
16
|
+
pyloid-0.18.0.dist-info/METADATA,sha256=O3WDD4p7eovP2WlT0AF15UJpF6HWA7XTTxD5AulEHts,3050
|
17
|
+
pyloid-0.18.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
18
|
+
pyloid-0.18.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|