pyloid 0.14.0__py3-none-any.whl → 0.14.2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
pyloid/pyloid.py
CHANGED
@@ -4,6 +4,7 @@ from PySide6.QtWidgets import (
|
|
4
4
|
QApplication,
|
5
5
|
QSystemTrayIcon,
|
6
6
|
QMenu,
|
7
|
+
QFileDialog,
|
7
8
|
)
|
8
9
|
from PySide6.QtGui import (
|
9
10
|
QIcon,
|
@@ -1240,3 +1241,83 @@ class Pyloid(QApplication):
|
|
1240
1241
|
"""
|
1241
1242
|
self.file_watcher.directory_changed.connect(callback)
|
1242
1243
|
|
1244
|
+
###########################################################################################
|
1245
|
+
# File dialog
|
1246
|
+
###########################################################################################
|
1247
|
+
def open_file_dialog(self, dir: Optional[str] = None, filter: Optional[str] = None) -> Optional[str]:
|
1248
|
+
"""
|
1249
|
+
Opens a file dialog to select a file to open.
|
1250
|
+
|
1251
|
+
Parameters
|
1252
|
+
----------
|
1253
|
+
dir : str, optional
|
1254
|
+
The initial directory that the dialog will open in. If None, the dialog will open in the current working directory.
|
1255
|
+
filter : str, optional
|
1256
|
+
A string that specifies the file types that can be selected. For example, "Text Files (*.txt);;All Files (*)".
|
1257
|
+
|
1258
|
+
Returns
|
1259
|
+
-------
|
1260
|
+
Optional[str]
|
1261
|
+
The path of the selected file. Returns None if no file is selected.
|
1262
|
+
|
1263
|
+
Examples
|
1264
|
+
--------
|
1265
|
+
>>> app = Pyloid(app_name="Pyloid-App")
|
1266
|
+
>>> file_path = app.open_file_dialog(dir="/home/user", filter="Text Files (*.txt)")
|
1267
|
+
>>> if file_path:
|
1268
|
+
>>> print("Selected file:", file_path)
|
1269
|
+
"""
|
1270
|
+
file_path, _ = QFileDialog.getOpenFileName(None, dir=dir, filter=filter)
|
1271
|
+
return file_path if file_path else None
|
1272
|
+
|
1273
|
+
def save_file_dialog(self, dir: Optional[str] = None, filter: Optional[str] = None) -> Optional[str]:
|
1274
|
+
"""
|
1275
|
+
Opens a file dialog to select a file to save.
|
1276
|
+
|
1277
|
+
Parameters
|
1278
|
+
----------
|
1279
|
+
dir : str, optional
|
1280
|
+
The initial directory that the dialog will open in. If None, the dialog will open in the current working directory.
|
1281
|
+
filter : str, optional
|
1282
|
+
A string that specifies the file types that can be saved. For example, "Text Files (*.txt);;All Files (*)".
|
1283
|
+
|
1284
|
+
Returns
|
1285
|
+
-------
|
1286
|
+
Optional[str]
|
1287
|
+
The path of the selected file. Returns None if no file is selected.
|
1288
|
+
|
1289
|
+
Examples
|
1290
|
+
--------
|
1291
|
+
>>> app = Pyloid(app_name="Pyloid-App")
|
1292
|
+
>>> file_path = app.save_file_dialog(dir="/home/user", filter="Text Files (*.txt)")
|
1293
|
+
>>> if file_path:
|
1294
|
+
>>> print("File will be saved to:", file_path)
|
1295
|
+
"""
|
1296
|
+
file_path, _ = QFileDialog.getSaveFileName(None, dir=dir, filter=filter)
|
1297
|
+
return file_path if file_path else None
|
1298
|
+
|
1299
|
+
def select_directory_dialog(self, dir: Optional[str] = None) -> Optional[str]:
|
1300
|
+
"""
|
1301
|
+
Opens a dialog to select a directory.
|
1302
|
+
|
1303
|
+
Parameters
|
1304
|
+
----------
|
1305
|
+
dir : str, optional
|
1306
|
+
The initial directory that the dialog will open in. If None, the dialog will open in the current working directory.
|
1307
|
+
|
1308
|
+
Returns
|
1309
|
+
-------
|
1310
|
+
Optional[str]
|
1311
|
+
The path of the selected directory. Returns None if no directory is selected.
|
1312
|
+
|
1313
|
+
Examples
|
1314
|
+
--------
|
1315
|
+
>>> app = Pyloid(app_name="Pyloid-App")
|
1316
|
+
>>> directory_path = app.select_directory_dialog(dir="/home/user")
|
1317
|
+
>>> if directory_path:
|
1318
|
+
>>> print("Selected directory:", directory_path)
|
1319
|
+
"""
|
1320
|
+
directory_path = QFileDialog.getExistingDirectory(None, dir=dir)
|
1321
|
+
return directory_path if directory_path else None
|
1322
|
+
|
1323
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyloid
|
3
|
-
Version: 0.14.
|
3
|
+
Version: 0.14.2
|
4
4
|
Summary:
|
5
5
|
Author: aesthetics-of-record
|
6
6
|
Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
|
@@ -23,18 +23,22 @@ Pyloid is the Python backend version of Electron and Tauri, designed to simplify
|
|
23
23
|
|
24
24
|
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.
|
25
25
|
|
26
|
-
|
26
|
+
### Key Features 🚀
|
27
27
|
|
28
28
|
- **Web-based GUI Generation**: Easily build the UI for desktop applications using HTML, CSS, and JavaScript.
|
29
29
|
- **System Tray Icon Support** 🖥️: Implement system tray icons with ease to add various utilities to your app.
|
30
30
|
- **Multi-Window Management**: Create and manage multiple windows effortlessly.
|
31
31
|
- **Bridge API between Python and JavaScript** 🌉: Facilitates smooth communication between Python and JavaScript to integrate various functionalities.
|
32
|
-
- **Single Instance Application
|
33
|
-
- **Comprehensive Desktop App Features**: Provides a wide range of functions for desktop apps, including monitor management, desktop capture, notifications, shortcuts, and clipboard access.
|
32
|
+
- **Single Instance Application / Multi Instance Application Support**: Supports both single and multi instance applications.
|
33
|
+
- **Comprehensive Desktop App Features**: Provides a wide range of functions for desktop apps, including monitor management, desktop capture, notifications, shortcuts, auto start, filewatcher and clipboard access.
|
34
34
|
- **Clean and Intuitive Code Structure**: Offers a simple and readable code structure that enhances developer productivity.
|
35
35
|
- **Live UI Development Experience**: Experience real-time UI updates as you modify your code, providing an efficient development workflow.
|
36
|
-
- **Cross-Platform Support**: Runs on various operating systems, including Windows, macOS, and Linux.
|
36
|
+
- **Cross-Platform Support**: Runs on various operating systems, including Windows, macOS, and Linux, Raspberry Pi OS.
|
37
37
|
- **Integration with Various Frontend Libraries**: Supports integration with frontend frameworks like HTML/CSS/JS and React.
|
38
|
+
- **Window Customization**: Customize window title bar and draggable region.
|
39
|
+
|
40
|
+
* **Direct Utilization of PySide6 Features** 🛠️: Leverage almost all features of PySide6 to customize and extend the Pyloid API, offering limitless possibilities.
|
41
|
+
* **Detailed Numpy-style Docstrings** 📚: Provide detailed and clear Numpy-style docstrings that greatly enhance the development experience, making it easy to understand and apply the API.
|
38
42
|
|
39
43
|
## Documentation 📚
|
40
44
|
|
@@ -7,11 +7,11 @@ pyloid/filewatcher.py,sha256=3M5zWVUf1OhlkWJcDFC8ZA9agO4Q-U8WdgGpy6kaVz0,4601
|
|
7
7
|
pyloid/js_api/event_api.py,sha256=_52yyBonqecmMvJpFW7OMNi_jX8Nrteqw_kI6r-DGG0,951
|
8
8
|
pyloid/js_api/window_api.py,sha256=JDAFIMMiw75PNcyO8_163PJdRY-dvFNBO3IN0TA-Xsw,5383
|
9
9
|
pyloid/monitor.py,sha256=nmcoOmlHeTysrZVT5mmL92ASbqMg8aH-hQg35qKWi0M,27540
|
10
|
-
pyloid/pyloid.py,sha256=
|
10
|
+
pyloid/pyloid.py,sha256=3YymePkpM_hKPzvHSSgELuSHkmbDsKW60HnRwwBMY7A,41178
|
11
11
|
pyloid/timer.py,sha256=RqMsChFUd93cxMVgkHWiIKrci0QDTBgJSTULnAtYT8M,8712
|
12
12
|
pyloid/tray.py,sha256=D12opVEc2wc2T4tK9epaN1oOdeziScsIVNM2uCN7C-A,1710
|
13
13
|
pyloid/utils.py,sha256=VGZE2liY8_AElEqxVe1YLbk3fWlcAevpRc6oOTTgi-U,1927
|
14
|
-
pyloid-0.14.
|
15
|
-
pyloid-0.14.
|
16
|
-
pyloid-0.14.
|
17
|
-
pyloid-0.14.
|
14
|
+
pyloid-0.14.2.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
|
15
|
+
pyloid-0.14.2.dist-info/METADATA,sha256=q1n-HGrGsAzDyw8CN3FEDA4VmtVX0IAN6JlrwI5rssc,4114
|
16
|
+
pyloid-0.14.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
17
|
+
pyloid-0.14.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|