pyloid 0.23.15__py3-none-any.whl → 0.23.17__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
@@ -877,8 +877,6 @@ class _BrowserWindow:
877
877
  self.dev_tools_window.setCentralWidget(dev_tools_view)
878
878
  self.dev_tools_window.resize(800, 600)
879
879
  self.dev_tools_window.show()
880
-
881
- # Add this line to handle dev tools window closure
882
880
  self.dev_tools_window.closeEvent = lambda event: setattr(
883
881
  self, "dev_tools_window", None
884
882
  )
pyloid/pyloid.py CHANGED
@@ -29,20 +29,37 @@ from PySide6.QtCore import QCoreApplication
29
29
  from PySide6.QtCore import Signal, QObject, Slot
30
30
  import uuid
31
31
  from PySide6.QtCore import QEventLoop
32
- import socket
33
32
  from typing import Any, Set
34
33
  from platformdirs import PlatformDirs
35
34
  from .store import Store
36
35
  from .rpc import PyloidRPC
37
36
  import threading
38
- import asyncio
37
+ import signal
39
38
 
40
39
  # software backend
41
40
  os.environ["QT_QUICK_BACKEND"] = "software"
42
41
 
42
+ #########################################################################
43
43
  # for linux debug
44
44
  os.environ["QTWEBENGINE_DICTIONARIES_PATH"] = "/"
45
45
 
46
+ original_set_wakeup_fd = signal.set_wakeup_fd
47
+ original_signal = signal.signal
48
+
49
+ def safe_set_wakeup_fd(fd, *args, **kwargs):
50
+ if threading.current_thread() is threading.main_thread():
51
+ return original_set_wakeup_fd(fd, *args, **kwargs)
52
+ return -1 # If not in main thread, do nothing and return -1
53
+
54
+ def safe_signal(signalnum, handler):
55
+ if threading.current_thread() is threading.main_thread():
56
+ return original_signal(signalnum, handler)
57
+ return None # If not in main thread, do nothing
58
+
59
+ signal.set_wakeup_fd = safe_set_wakeup_fd
60
+ signal.signal = safe_signal
61
+ #########################################################################
62
+
46
63
  # for macos debug
47
64
  logging.getLogger("Qt").setLevel(logging.ERROR)
48
65
 
pyloid/store.py CHANGED
@@ -1,3 +1,4 @@
1
+ import os
1
2
  from pickledb import PickleDB
2
3
  from typing import Any, List, Optional
3
4
 
@@ -16,6 +17,7 @@ class Store:
16
17
  --------
17
18
  >>> store = Store("data.json")
18
19
  """
20
+ os.makedirs(os.path.dirname(path), exist_ok=True)
19
21
  self.db = PickleDB(path)
20
22
 
21
23
  def get(self, key: str) -> Any:
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.3
2
+ Name: pyloid
3
+ Version: 0.23.17
4
+ Summary:
5
+ Author: aesthetics-of-record
6
+ Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
7
+ Requires-Python: >=3.9,<3.14
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Requires-Dist: aiohttp-cors (>=0.8.1,<0.9.0)
15
+ Requires-Dist: pickledb (>=1.3.2,<2.0.0)
16
+ Requires-Dist: platformdirs (>=4.3.7,<5.0.0)
17
+ Requires-Dist: pyside6 (>=6.8.2.1,<7.0.0.0)
18
+ Description-Content-Type: text/markdown
19
+
20
+ <h1 style="text-align: center; font-size: 200px; font-weight: 500;">
21
+ <i>Pyloid</i>
22
+ </h1>
23
+
24
+ ![example image](example.png)
25
+
26
+ <h2 align="center" style="font-size: 28px;"><b>Pyloid: Thread-Safe Desktop Apps—Unified with Any Frontend and Python Technology</b></h2>
27
+
28
+
29
+ ## 💡 Key Features
30
+
31
+ - **All Frontend Frameworks** are supported
32
+ - **All features necessary** for a desktop application are implemented
33
+ - Through thread-safe implementation, it seamlessly **integrates with any Python framework**
34
+ - **RPC** between Python and JavaScript
35
+ - Single Instance Application / Multi Instance Application Support
36
+ - Multi-Window Application Support
37
+ - Clean and Intuitive Code Structure
38
+ - **Cross-Platform Support**
39
+ - Window Customization
40
+ - **Detailed Numpy-style Docstrings**
41
+
42
+
43
+
44
+ ## 🚀 Getting Started
45
+
46
+ ### [Prerequisites](https://docs.pyloid.com/getting-started/prerequisites)
47
+
48
+ - Node.js
49
+ - Python
50
+ - uv
51
+
52
+ ### [Create Project](https://docs.pyloid.com/getting-started/create-pyloid-app)
53
+
54
+ ```bash
55
+ npm create pyloid-app@latest
56
+ ```
57
+
58
+ ## Documentation 📚
59
+
60
+ [Pyloid Documentation](https://docs.pyloid.com/)
61
+
62
+ ## License
63
+
64
+ This project is licensed under the terms of the Apache License 2.0. See the [LICENSE](./LICENSE) file for details.
65
+
66
+ This project uses PySide6, which is licensed under the LGPL (Lesser General Public License).
67
+
68
+ ## Contributing 🤝
69
+
70
+
71
+
72
+ ## Issues
73
+
74
+ If you encounter any issues or have suggestions for improvements, please open an issue on the [GitHub repository](https://github.com/Pyloid/pyloid/issues).
75
+
@@ -1,23 +1,23 @@
1
1
  pyloid/__init__.py,sha256=YKwMCSOds1QVi9N7EGfY0Z7BEjJn8j6HGqRblZlZClA,235
2
2
  pyloid/api.py,sha256=A61Kmddh8BlpT3LfA6NbPQNzFmD95vQ4WKX53oKsGYU,2419
3
3
  pyloid/autostart.py,sha256=K7DQYl4LHItvPp0bt1V9WwaaZmVSTeGvadkcwG-KKrI,3899
4
- pyloid/browser_window.py,sha256=HJclf_0eXK2nIo7jKX_0N1-ApVF2xeYChKjhzq2U07s,100685
4
+ pyloid/browser_window.py,sha256=MR01MllBnidZCiBmVZfdFYaMuLi5OZO6lKPJ09Uqoyg,100623
5
5
  pyloid/custom/titlebar.py,sha256=itzK9pJbZMQ7BKca9kdbuHMffurrw15UijR6OU03Xsk,3894
6
6
  pyloid/filewatcher.py,sha256=3M5zWVUf1OhlkWJcDFC8ZA9agO4Q-U8WdgGpy6kaVz0,4601
7
7
  pyloid/js_api/base.py,sha256=XD3sqWYAb1nw6VgY3xXsU4ls5xLGrxpOqmLRJm_vBso,8669
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
11
- pyloid/pyloid.py,sha256=c-aiU_c3p2vsU34HIgrUx6iqKlh7JyiVLcqo3ji3Pfc,84604
11
+ pyloid/pyloid.py,sha256=xOg452QZttSxYU9G0GMZCFvm391yF5fTAjY3jJfyozc,85340
12
12
  pyloid/rpc.py,sha256=U3G6d5VgCibT0XwSX6eNhLePNyUG8ejfJSf8F43zBpk,18601
13
13
  pyloid/serve.py,sha256=wJIBqiLr1-8FvBdV3yybeBtVXsu94FfWYKjHL0eQ68s,1444
14
- pyloid/store.py,sha256=p0plJj52hQjjtNMVJhy20eNLXfQ3Qmf7LtGHQk7FiPg,4471
14
+ pyloid/store.py,sha256=teoa-HYzwm93Rivcw3AhKw6rAmQqQ_kmF6XYSkC3G_I,4541
15
15
  pyloid/thread_pool.py,sha256=fKOBb8jMfZn_7crA_fJCno8dObBRZE31EIWaNQ759aw,14616
16
16
  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=NqB8W-irXDtTGb74rrJ2swU6tgzU0HSE8lGewrStOKc,5685
20
- pyloid-0.23.15.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
21
- pyloid-0.23.15.dist-info/METADATA,sha256=mY6P5kOeMvYmD8KQ2X_qC5VCrJQ6udi_MeMlmHDTb_8,3198
22
- pyloid-0.23.15.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
23
- pyloid-0.23.15.dist-info/RECORD,,
20
+ pyloid-0.23.17.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
21
+ pyloid-0.23.17.dist-info/METADATA,sha256=dIEriBfubwQN74-AGtmK8Xiwjyuf1TrJ6jYSTSdcf_o,2216
22
+ pyloid-0.23.17.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
23
+ pyloid-0.23.17.dist-info/RECORD,,
@@ -1,97 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: pyloid
3
- Version: 0.23.15
4
- Summary:
5
- Author: aesthetics-of-record
6
- Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
7
- Requires-Python: >=3.9,<3.14
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.9
10
- Classifier: Programming Language :: Python :: 3.10
11
- Classifier: Programming Language :: Python :: 3.11
12
- Classifier: Programming Language :: Python :: 3.12
13
- Classifier: Programming Language :: Python :: 3.13
14
- Requires-Dist: aiohttp-cors (>=0.8.1,<0.9.0)
15
- Requires-Dist: pickledb (>=1.3.2,<2.0.0)
16
- Requires-Dist: platformdirs (>=4.3.7,<5.0.0)
17
- Requires-Dist: pyside6 (>=6.8.2.1,<7.0.0.0)
18
- Description-Content-Type: text/markdown
19
-
20
- # Pyloid 👋
21
-
22
- Pyloid is the Python backend version of Electron and Tauri, designed to simplify desktop application development. This open-source project, built on **QtWebEngine** and **PySide6**, provides seamless integration with various Python features, making it easy to build powerful applications effortlessly.
23
-
24
- ![example image](example.png)
25
-
26
- ## Why Pyloid?
27
-
28
- With Pyloid, you can leverage the full power of Python in your desktop applications. Its simplicity and flexibility make it the perfect choice for both beginners and experienced developers looking for a Python-focused alternative to Electron or Tauri. It is especially optimized for building AI-powered desktop applications.
29
-
30
- ### Key Features 🚀
31
-
32
- - **Web-based GUI Generation**
33
- - **System Tray Icon Support**
34
- - **Multi-Window Management**
35
- - **Bridge API between Python and JavaScript**
36
- - **Single Instance Application / Multi Instance Application Support**
37
- - **Comprehensive Desktop App Features**
38
- - **Clean and Intuitive Code Structure**
39
- - **Live UI Development Experience**
40
- - **Cross-Platform Support**
41
- - **Integration with Various Frontend Libraries**
42
- - **Window Customization**
43
- - **Direct Utilization of PySide6 Features**
44
- - **Detailed Numpy-style Docstrings**
45
-
46
- ## Documentation 📚
47
-
48
- [Pyloid Documentation](https://docs.pyloid.com/)
49
-
50
- ### Create Project 📦
51
-
52
- #### Creating a HTML/CSS/JS + Pyloid Project 🌐
53
-
54
- [https://github.com/pylonic/pyloid_html_boilerplate](https://github.com/Pyloid/pyloid_html_boilerplate)
55
-
56
- #### Creating a React + Vite + Pyloid Project ⚛️
57
-
58
- [https://github.com/pylonic/pyloid_react_boilerplate](https://github.com/Pyloid/pyloid_react_boilerplate)
59
-
60
- ### Custom Your Boilerplate 🔨
61
-
62
- ```bash
63
- pip install pyloid
64
- ```
65
-
66
- Package URL: [https://pypi.org/project/pyloid/](https://pypi.org/project/pyloid/)
67
-
68
- ## Usage 🛠️
69
-
70
- ### Creating a Basic Application
71
-
72
- ```python
73
- from pyloid import Pyloid
74
-
75
- app = Pyloid(app_name="Pyloid-App", single_instance=True)
76
-
77
- win = app.create_window("pyloid-example")
78
- win.load_url("https://www.example.com")
79
- win.show_and_focus()
80
-
81
- app.run()
82
- ```
83
-
84
- ## License 📄
85
-
86
- This project is licensed under the terms of the Apache License 2.0. See the [LICENSE](./LICENSE) file for details.
87
-
88
- This project uses PySide6, which is licensed under the LGPL (Lesser General Public License).
89
-
90
- ## Contributing 🤝
91
-
92
- Not Yet
93
-
94
- ## Issues
95
-
96
- If you encounter any issues or have suggestions for improvements, please open an issue on the [GitHub repository](https://github.com/Pyloid/pyloid/issues).
97
-