pyloid 0.23.14__py3-none-any.whl → 0.23.16__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
@@ -928,6 +928,9 @@ class _BrowserWindow:
928
928
  >>> window = app.create_window("pyloid-window")
929
929
  >>> window.show()
930
930
  """
931
+ # 최소화 상태라면 먼저 복원
932
+ if self._window.isMinimized():
933
+ self._window.showNormal()
931
934
  self._window.show()
932
935
 
933
936
  def focus(self):
@@ -940,14 +943,8 @@ class _BrowserWindow:
940
943
  >>> window = app.create_window("pyloid-window")
941
944
  >>> window.focus()
942
945
  """
943
- was_on_top = bool(self._window.windowFlags() & Qt.WindowStaysOnTopHint)
944
- if not was_on_top:
945
- self._window.setWindowFlag(Qt.WindowStaysOnTopHint, True)
946
- self._window.show()
946
+ self._window.raise_()
947
947
  self._window.activateWindow()
948
- if not was_on_top:
949
- self._window.setWindowFlag(Qt.WindowStaysOnTopHint, False)
950
- self._window.show()
951
948
 
952
949
  def show_and_focus(self):
953
950
  """
@@ -959,14 +956,23 @@ class _BrowserWindow:
959
956
  >>> window = app.create_window("pyloid-window")
960
957
  >>> window.show_and_focus()
961
958
  """
962
- was_on_top = bool(self._window.windowFlags() & Qt.WindowStaysOnTopHint)
963
- if not was_on_top:
964
- self._window.setWindowFlag(Qt.WindowStaysOnTopHint, True)
965
- self._window.show()
959
+ # 최소화 상태라면 먼저 복원
960
+ if self._window.isMinimized():
961
+ self._window.showNormal()
962
+ self._window.show()
963
+ self._window.raise_()
966
964
  self._window.activateWindow()
967
- if not was_on_top:
968
- self._window.setWindowFlag(Qt.WindowStaysOnTopHint, False)
969
- self._window.show()
965
+
966
+ # was_on_top = bool(self._window.windowFlags() & Qt.WindowStaysOnTopHint)
967
+ # if not was_on_top:
968
+ # self._window.setWindowFlag(Qt.WindowStaysOnTopHint, True)
969
+ # self._window.show()
970
+
971
+ # self._window.activateWindow()
972
+
973
+ # if not was_on_top:
974
+ # self._window.setWindowFlag(Qt.WindowStaysOnTopHint, False)
975
+ # self._window.show()
970
976
 
971
977
  def close(self):
972
978
  """
pyloid/pyloid.py CHANGED
@@ -36,13 +36,32 @@ from .store import Store
36
36
  from .rpc import PyloidRPC
37
37
  import threading
38
38
  import asyncio
39
+ import signal
39
40
 
40
41
  # software backend
41
42
  os.environ["QT_QUICK_BACKEND"] = "software"
42
43
 
44
+ #########################################################################
43
45
  # for linux debug
44
46
  os.environ["QTWEBENGINE_DICTIONARIES_PATH"] = "/"
45
47
 
48
+ original_set_wakeup_fd = signal.set_wakeup_fd
49
+ original_signal = signal.signal
50
+
51
+ def safe_set_wakeup_fd(fd, *args, **kwargs):
52
+ if threading.current_thread() is threading.main_thread():
53
+ return original_set_wakeup_fd(fd, *args, **kwargs)
54
+ return -1 # 메인 스레드가 아닌 경우 아무것도 하지 않고 -1 반환
55
+
56
+ def safe_signal(signalnum, handler):
57
+ if threading.current_thread() is threading.main_thread():
58
+ return original_signal(signalnum, handler)
59
+ return None # 메인 스레드가 아닌 경우 아무것도 하지 않음
60
+
61
+ signal.set_wakeup_fd = safe_set_wakeup_fd
62
+ signal.signal = safe_signal
63
+ #########################################################################
64
+
46
65
  # for macos debug
47
66
  logging.getLogger("Qt").setLevel(logging.ERROR)
48
67
 
@@ -419,20 +438,8 @@ class _Pyloid(QApplication):
419
438
  ```
420
439
  """
421
440
  if self.windows_dict:
422
- # 첫 번째 윈도우 가져오기
423
441
  main_window = next(iter(self.windows_dict.values()))
424
- was_on_top = bool(
425
- main_window._window._window.windowFlags() & Qt.WindowStaysOnTopHint
426
- )
427
- if not was_on_top:
428
- main_window._window._window.setWindowFlag(Qt.WindowStaysOnTopHint, True)
429
- main_window._window._window.show()
430
- main_window._window.activateWindow()
431
- if not was_on_top:
432
- main_window._window._window.setWindowFlag(
433
- Qt.WindowStaysOnTopHint, False
434
- )
435
- main_window._window._window.show()
442
+ main_window.focus()
436
443
 
437
444
  def show_and_focus_main_window(self):
438
445
  """
@@ -446,21 +453,8 @@ class _Pyloid(QApplication):
446
453
  ```
447
454
  """
448
455
  if self.windows_dict:
449
- main_window = next(iter(self.windows_dict.values()))
450
- main_window._window.show()
451
-
452
- was_on_top = bool(
453
- main_window._window._window.windowFlags() & Qt.WindowStaysOnTopHint
454
- )
455
- if not was_on_top:
456
- main_window._window._window.setWindowFlag(Qt.WindowStaysOnTopHint, True)
457
- main_window._window._window.show()
458
- main_window._window._window.activateWindow()
459
- if not was_on_top:
460
- main_window._window._window.setWindowFlag(
461
- Qt.WindowStaysOnTopHint, False
462
- )
463
- main_window._window._window.show()
456
+ main_window = next(iter(self.windows_dict.values()))
457
+ main_window.show_and_focus()
464
458
 
465
459
  def close_all_windows(self):
466
460
  """
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.3
2
+ Name: pyloid
3
+ Version: 0.23.16
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,14 +1,14 @@
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=4w9xsTzn66YEhRRuVzu4ZXcYGh_-GQL829fYGX6ZXwc,100593
4
+ pyloid/browser_window.py,sha256=HJclf_0eXK2nIo7jKX_0N1-ApVF2xeYChKjhzq2U07s,100685
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=r70Xa-SKk0yZsJ_d2Kl-adLy7P2VX1yqxymVBVeNNa8,85762
11
+ pyloid/pyloid.py,sha256=IyoQfRXJ1U2YMur-1J7HULszGMikL8MLqFgXoUb0crQ,85421
12
12
  pyloid/rpc.py,sha256=U3G6d5VgCibT0XwSX6eNhLePNyUG8ejfJSf8F43zBpk,18601
13
13
  pyloid/serve.py,sha256=wJIBqiLr1-8FvBdV3yybeBtVXsu94FfWYKjHL0eQ68s,1444
14
14
  pyloid/store.py,sha256=p0plJj52hQjjtNMVJhy20eNLXfQ3Qmf7LtGHQk7FiPg,4471
@@ -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=NqB8W-irXDtTGb74rrJ2swU6tgzU0HSE8lGewrStOKc,5685
20
- pyloid-0.23.14.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
21
- pyloid-0.23.14.dist-info/METADATA,sha256=sTDDizcEkMiTI6c9q41GQE3h-w4w-BUWZsf-yrzFykQ,3198
22
- pyloid-0.23.14.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
23
- pyloid-0.23.14.dist-info/RECORD,,
20
+ pyloid-0.23.16.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
21
+ pyloid-0.23.16.dist-info/METADATA,sha256=aaWrHQErXdEKNyYR1eWx36pHv_iIf31oxdzIFAS4J3U,2216
22
+ pyloid-0.23.16.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
23
+ pyloid-0.23.16.dist-info/RECORD,,
@@ -1,97 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: pyloid
3
- Version: 0.23.14
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
-