pyloid 0.17.3__tar.gz → 0.18.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pyloid-0.17.3 → pyloid-0.18.0}/PKG-INFO +3 -3
- {pyloid-0.17.3 → pyloid-0.18.0}/pyproject.toml +3 -3
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/api.py +8 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/browser_window.py +10 -5
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/js_api/window_api.py +4 -4
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/utils.py +3 -2
- {pyloid-0.17.3 → pyloid-0.18.0}/LICENSE +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/README.md +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/__init__.py +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/autostart.py +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/custom/titlebar.py +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/filewatcher.py +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/js_api/event_api.py +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/monitor.py +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/pyloid.py +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/thread_pool.py +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/timer.py +0 -0
- {pyloid-0.17.3 → pyloid-0.18.0}/src/pyloid/tray.py +0 -0
@@ -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,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "pyloid"
|
3
|
-
version = "0.
|
3
|
+
version = "0.18.0"
|
4
4
|
description = ""
|
5
5
|
authors = ["aesthetics-of-record <111675679+aesthetics-of-record@users.noreply.github.com>"]
|
6
6
|
readme = "README.md"
|
@@ -9,8 +9,8 @@ packages = [
|
|
9
9
|
]
|
10
10
|
|
11
11
|
[tool.poetry.dependencies]
|
12
|
-
python = ">=3.9,<3.
|
13
|
-
pyside6 = "^6.8.
|
12
|
+
python = ">=3.9,<3.14"
|
13
|
+
pyside6 = "^6.8.1"
|
14
14
|
|
15
15
|
|
16
16
|
[build-system]
|
@@ -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):
|
@@ -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)
|
@@ -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):
|
@@ -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
|
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
|