psi6 0.1.0__tar.gz
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.
- psi6-0.1.0/LICENSE +21 -0
- psi6-0.1.0/PKG-INFO +101 -0
- psi6-0.1.0/README.md +67 -0
- psi6-0.1.0/pyproject.toml +61 -0
- psi6-0.1.0/src/psi6/__init__.py +148 -0
- psi6-0.1.0/src/psi6/__main__.py +34 -0
- psi6-0.1.0/src/psi6/examples/__init__.py +6 -0
- psi6-0.1.0/src/psi6/examples/file_index.py +23 -0
- psi6-0.1.0/src/psi6/examples/kit.py +518 -0
- psi6-0.1.0/src/psi6/examples/visual_qa.py +60 -0
- psi6-0.1.0/src/psi6/icons/__init__.py +26 -0
- psi6-0.1.0/src/psi6/icons/export.py +24 -0
- psi6-0.1.0/src/psi6/icons/glyphs.py +85 -0
- psi6-0.1.0/src/psi6/icons/registry.py +74 -0
- psi6-0.1.0/src/psi6/icons/render.py +43 -0
- psi6-0.1.0/src/psi6/icons/svg/activity.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/bot.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/check.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/chevron-down.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/chevron-left.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/chevron-right.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/chevron-up.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/circle-dot.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/clock.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/command.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/copy.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/download.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/error.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/file-plus.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/file.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/film.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/folder.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/git-branch.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/grid.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/inbox.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/info.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/layout-dashboard.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/list.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/message.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/minus.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/monitor.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/moon.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/more.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/music.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/pause.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/play.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/plus.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/refresh.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/search.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/send.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/settings.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/sidebar.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/skip-back.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/skip-forward.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/sliders.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/success.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/sun.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/table.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/terminal.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/trash.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/volume-off.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/volume.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/warning.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/win-close.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/win-max.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/win-min.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/win-restore.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/wrench.svg +1 -0
- psi6-0.1.0/src/psi6/icons/svg/x.svg +1 -0
- psi6-0.1.0/src/psi6/jobs/__init__.py +5 -0
- psi6-0.1.0/src/psi6/jobs/file_index.py +126 -0
- psi6-0.1.0/src/psi6/py.typed +0 -0
- psi6-0.1.0/src/psi6/runtime/__init__.py +30 -0
- psi6-0.1.0/src/psi6/runtime/app.py +204 -0
- psi6-0.1.0/src/psi6/runtime/config.py +85 -0
- psi6-0.1.0/src/psi6/runtime/errors.py +73 -0
- psi6-0.1.0/src/psi6/runtime/job.py +40 -0
- psi6-0.1.0/src/psi6/runtime/logs.py +25 -0
- psi6-0.1.0/src/psi6/runtime/notifications.py +85 -0
- psi6-0.1.0/src/psi6/runtime/qt_env.py +104 -0
- psi6-0.1.0/src/psi6/runtime/single_instance.py +80 -0
- psi6-0.1.0/src/psi6/runtime/tasks.py +383 -0
- psi6-0.1.0/src/psi6/runtime/window_state.py +36 -0
- psi6-0.1.0/src/psi6/templates/__init__.py +5 -0
- psi6-0.1.0/src/psi6/templates/batch_tool.py +300 -0
- psi6-0.1.0/src/psi6/theme/__init__.py +22 -0
- psi6-0.1.0/src/psi6/theme/apply.py +841 -0
- psi6-0.1.0/src/psi6/theme/chrome.py +55 -0
- psi6-0.1.0/src/psi6/theme/files.py +154 -0
- psi6-0.1.0/src/psi6/theme/paint.py +125 -0
- psi6-0.1.0/src/psi6/theme/presets/brass.json +17 -0
- psi6-0.1.0/src/psi6/theme/presets/compact.json +4 -0
- psi6-0.1.0/src/psi6/theme/presets/example.toml +8 -0
- psi6-0.1.0/src/psi6/theme/runtime.py +62 -0
- psi6-0.1.0/src/psi6/theme/system.py +15 -0
- psi6-0.1.0/src/psi6/theme/tokens.py +239 -0
- psi6-0.1.0/src/psi6/ui/__init__.py +133 -0
- psi6-0.1.0/src/psi6/ui/_path_picker.py +169 -0
- psi6-0.1.0/src/psi6/ui/_tone.py +19 -0
- psi6-0.1.0/src/psi6/ui/action_bar.py +29 -0
- psi6-0.1.0/src/psi6/ui/app_shell.py +226 -0
- psi6-0.1.0/src/psi6/ui/banner.py +85 -0
- psi6-0.1.0/src/psi6/ui/busy.py +61 -0
- psi6-0.1.0/src/psi6/ui/buttons.py +43 -0
- psi6-0.1.0/src/psi6/ui/chat.py +228 -0
- psi6-0.1.0/src/psi6/ui/check_list.py +124 -0
- psi6-0.1.0/src/psi6/ui/chrome.py +119 -0
- psi6-0.1.0/src/psi6/ui/collapsible.py +83 -0
- psi6-0.1.0/src/psi6/ui/command_palette.py +128 -0
- psi6-0.1.0/src/psi6/ui/content_dialog.py +58 -0
- psi6-0.1.0/src/psi6/ui/data_table.py +250 -0
- psi6-0.1.0/src/psi6/ui/desktop_window.py +241 -0
- psi6-0.1.0/src/psi6/ui/dialogs.py +42 -0
- psi6-0.1.0/src/psi6/ui/diff_view.py +51 -0
- psi6-0.1.0/src/psi6/ui/drop_zone.py +238 -0
- psi6-0.1.0/src/psi6/ui/empty_state.py +88 -0
- psi6-0.1.0/src/psi6/ui/file_input.py +101 -0
- psi6-0.1.0/src/psi6/ui/filters.py +101 -0
- psi6-0.1.0/src/psi6/ui/flow_layout.py +85 -0
- psi6-0.1.0/src/psi6/ui/form.py +567 -0
- psi6-0.1.0/src/psi6/ui/icon.py +179 -0
- psi6-0.1.0/src/psi6/ui/image_well.py +114 -0
- psi6-0.1.0/src/psi6/ui/kbd.py +13 -0
- psi6-0.1.0/src/psi6/ui/log_panel.py +138 -0
- psi6-0.1.0/src/psi6/ui/playlist.py +79 -0
- psi6-0.1.0/src/psi6/ui/property_list.py +99 -0
- psi6-0.1.0/src/psi6/ui/search_field.py +50 -0
- psi6-0.1.0/src/psi6/ui/section.py +59 -0
- psi6-0.1.0/src/psi6/ui/segmented.py +66 -0
- psi6-0.1.0/src/psi6/ui/setting_row.py +58 -0
- psi6-0.1.0/src/psi6/ui/settings_page.py +173 -0
- psi6-0.1.0/src/psi6/ui/sparkline.py +56 -0
- psi6-0.1.0/src/psi6/ui/status_badge.py +32 -0
- psi6-0.1.0/src/psi6/ui/stepper.py +99 -0
- psi6-0.1.0/src/psi6/ui/switch.py +100 -0
- psi6-0.1.0/src/psi6/ui/tag.py +114 -0
- psi6-0.1.0/src/psi6/ui/task_panel.py +67 -0
- psi6-0.1.0/src/psi6/ui/title_bar.py +149 -0
- psi6-0.1.0/src/psi6/ui/toast.py +152 -0
- psi6-0.1.0/src/psi6/ui/tone.py +15 -0
- psi6-0.1.0/src/psi6/ui/transport.py +112 -0
- psi6-0.1.0/src/psi6/ui/tray.py +134 -0
- psi6-0.1.0/src/psi6/ui/window_shape.py +176 -0
- psi6-0.1.0/src/psi6/ui/workbench.py +163 -0
psi6-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 modaye
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
psi6-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: psi6
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: PySide6 desktop SDK: App runtime, batch jobs, theme tokens, and window chrome.
|
|
5
|
+
Keywords: pyside6,qt,desktop,gui,theme,tray
|
|
6
|
+
Author: modaye
|
|
7
|
+
Author-email: modaye <flywacool@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: X11 Applications :: Qt
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: MacOS
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
20
|
+
Requires-Dist: pydantic>=2.11
|
|
21
|
+
Requires-Dist: pyside6>=6.8
|
|
22
|
+
Requires-Dist: pytest>=8.3 ; extra == 'dev'
|
|
23
|
+
Requires-Dist: pytest-qt>=4.4 ; extra == 'dev'
|
|
24
|
+
Requires-Dist: pyyaml>=6 ; extra == 'dev'
|
|
25
|
+
Requires-Dist: pyyaml>=6 ; extra == 'yaml'
|
|
26
|
+
Requires-Python: >=3.13
|
|
27
|
+
Project-URL: Homepage, https://github.com/modaye/psi6
|
|
28
|
+
Project-URL: Repository, https://github.com/modaye/psi6
|
|
29
|
+
Project-URL: Issues, https://github.com/modaye/psi6/issues
|
|
30
|
+
Project-URL: Changelog, https://github.com/modaye/psi6/releases
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Provides-Extra: yaml
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# psi6
|
|
36
|
+
|
|
37
|
+
面向 AI Coding Agent 的 PySide6 基建:**运行时、批处理、主题、窗壳**(自定义标题栏、托盘、防多开)。
|
|
38
|
+
**不包含 Excel/PDF 等业务模板,也不为某个产品堆叠首页主键。** 行业逻辑写在你的应用里。
|
|
39
|
+
|
|
40
|
+
## 安装
|
|
41
|
+
|
|
42
|
+
运行或依赖这个库:
|
|
43
|
+
|
|
44
|
+
```powershell
|
|
45
|
+
pip install psi6
|
|
46
|
+
# 或
|
|
47
|
+
uv add psi6
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
YAML 主题额外需要:`pip install psi6[yaml]`。
|
|
51
|
+
|
|
52
|
+
`pip` **不会**安装 Cursor / Claude skill。skill 只在 Git 仓库的 `.cursor/skills/psi6-desktop/`。用 AI 写 psi6 应用时,clone 本仓库,或把该目录拷进你的项目。
|
|
53
|
+
|
|
54
|
+
## 使用路线
|
|
55
|
+
|
|
56
|
+
1. **运行时**:`App` + `DesktopWindow`。`app.run(window, tray=True)` 托盘;默认防多开、记住位置。参数用 Pydantic + `pydantic_form`。
|
|
57
|
+
2. **批处理**:耗时工作进 `TaskRunner`(`exclusive=` / `is_busy`),或可继承的 `BatchToolWindow(..., icon=..., exclusive=...)`。
|
|
58
|
+
3. **主题**:`App(..., theme="dark"|"auto"|Path)`;JSON / TOML / YAML 覆盖 token。图标放主题旁 `icons/search.svg`。不要写 QSS。
|
|
59
|
+
4. **窗壳**:`TitleBar` 拖动 / 最大化 / 从最大化拖出;`TrayIcon` 随主题换色;圆角窗最大化时取消圆角。
|
|
60
|
+
5. **改控件**:先构造参数;不够则子类覆盖公开钩子(如 `BatchToolWindow.present_outcome`、`DataTable.display_text`)。自绘用 `create_painter` / `token_color`。不要碰 `_` 私有实现。
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from psi6 import App
|
|
64
|
+
from psi6.ui.desktop_window import DesktopWindow
|
|
65
|
+
|
|
66
|
+
app = App("demo")
|
|
67
|
+
window = DesktopWindow(title="Demo")
|
|
68
|
+
raise SystemExit(app.run(window, tray=True))
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
文件索引只是 `run_job` 合同示例(扫盘、取消、失败可读),不是要复制的产品。
|
|
72
|
+
|
|
73
|
+
```powershell
|
|
74
|
+
uv run python -m psi6 kit
|
|
75
|
+
uv run python -m psi6 shot
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
规则在 `.cursor/skills/psi6-desktop/SKILL.md`。
|
|
79
|
+
|
|
80
|
+
## 从源码开发
|
|
81
|
+
|
|
82
|
+
```powershell
|
|
83
|
+
uv sync --extra dev
|
|
84
|
+
uv run psi6
|
|
85
|
+
uv run pytest
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 发布
|
|
89
|
+
|
|
90
|
+
1. 在 GitHub 建公开仓库(默认按 `modaye/psi6` 写进了元数据;用户名不同就改 `pyproject.toml` 的 `[project.urls]`)。
|
|
91
|
+
2. 在 PyPI 打开 Trusted Publishing,pending publisher 填:owner、仓库名、工作流 `publish.yml`、环境 `pypi`。
|
|
92
|
+
3. GitHub 仓库 Settings → Environments 新建 `pypi`。
|
|
93
|
+
4. 打与 `pyproject.toml` 相同的版本标签,例如 `git tag v0.1.0 && git push origin v0.1.0`,Actions 会 `uv build` 并 `uv publish`。
|
|
94
|
+
|
|
95
|
+
本地试发 TestPyPI:`uv build` 然后 `uv publish --index testpypi`。
|
|
96
|
+
|
|
97
|
+
## 测试
|
|
98
|
+
|
|
99
|
+
```powershell
|
|
100
|
+
uv run pytest
|
|
101
|
+
```
|
psi6-0.1.0/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# psi6
|
|
2
|
+
|
|
3
|
+
面向 AI Coding Agent 的 PySide6 基建:**运行时、批处理、主题、窗壳**(自定义标题栏、托盘、防多开)。
|
|
4
|
+
**不包含 Excel/PDF 等业务模板,也不为某个产品堆叠首页主键。** 行业逻辑写在你的应用里。
|
|
5
|
+
|
|
6
|
+
## 安装
|
|
7
|
+
|
|
8
|
+
运行或依赖这个库:
|
|
9
|
+
|
|
10
|
+
```powershell
|
|
11
|
+
pip install psi6
|
|
12
|
+
# 或
|
|
13
|
+
uv add psi6
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
YAML 主题额外需要:`pip install psi6[yaml]`。
|
|
17
|
+
|
|
18
|
+
`pip` **不会**安装 Cursor / Claude skill。skill 只在 Git 仓库的 `.cursor/skills/psi6-desktop/`。用 AI 写 psi6 应用时,clone 本仓库,或把该目录拷进你的项目。
|
|
19
|
+
|
|
20
|
+
## 使用路线
|
|
21
|
+
|
|
22
|
+
1. **运行时**:`App` + `DesktopWindow`。`app.run(window, tray=True)` 托盘;默认防多开、记住位置。参数用 Pydantic + `pydantic_form`。
|
|
23
|
+
2. **批处理**:耗时工作进 `TaskRunner`(`exclusive=` / `is_busy`),或可继承的 `BatchToolWindow(..., icon=..., exclusive=...)`。
|
|
24
|
+
3. **主题**:`App(..., theme="dark"|"auto"|Path)`;JSON / TOML / YAML 覆盖 token。图标放主题旁 `icons/search.svg`。不要写 QSS。
|
|
25
|
+
4. **窗壳**:`TitleBar` 拖动 / 最大化 / 从最大化拖出;`TrayIcon` 随主题换色;圆角窗最大化时取消圆角。
|
|
26
|
+
5. **改控件**:先构造参数;不够则子类覆盖公开钩子(如 `BatchToolWindow.present_outcome`、`DataTable.display_text`)。自绘用 `create_painter` / `token_color`。不要碰 `_` 私有实现。
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
from psi6 import App
|
|
30
|
+
from psi6.ui.desktop_window import DesktopWindow
|
|
31
|
+
|
|
32
|
+
app = App("demo")
|
|
33
|
+
window = DesktopWindow(title="Demo")
|
|
34
|
+
raise SystemExit(app.run(window, tray=True))
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
文件索引只是 `run_job` 合同示例(扫盘、取消、失败可读),不是要复制的产品。
|
|
38
|
+
|
|
39
|
+
```powershell
|
|
40
|
+
uv run python -m psi6 kit
|
|
41
|
+
uv run python -m psi6 shot
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
规则在 `.cursor/skills/psi6-desktop/SKILL.md`。
|
|
45
|
+
|
|
46
|
+
## 从源码开发
|
|
47
|
+
|
|
48
|
+
```powershell
|
|
49
|
+
uv sync --extra dev
|
|
50
|
+
uv run psi6
|
|
51
|
+
uv run pytest
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 发布
|
|
55
|
+
|
|
56
|
+
1. 在 GitHub 建公开仓库(默认按 `modaye/psi6` 写进了元数据;用户名不同就改 `pyproject.toml` 的 `[project.urls]`)。
|
|
57
|
+
2. 在 PyPI 打开 Trusted Publishing,pending publisher 填:owner、仓库名、工作流 `publish.yml`、环境 `pypi`。
|
|
58
|
+
3. GitHub 仓库 Settings → Environments 新建 `pypi`。
|
|
59
|
+
4. 打与 `pyproject.toml` 相同的版本标签,例如 `git tag v0.1.0 && git push origin v0.1.0`,Actions 会 `uv build` 并 `uv publish`。
|
|
60
|
+
|
|
61
|
+
本地试发 TestPyPI:`uv build` 然后 `uv publish --index testpypi`。
|
|
62
|
+
|
|
63
|
+
## 测试
|
|
64
|
+
|
|
65
|
+
```powershell
|
|
66
|
+
uv run pytest
|
|
67
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "psi6"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "PySide6 desktop SDK: App runtime, batch jobs, theme tokens, and window chrome."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "modaye", email = "flywacool@gmail.com" },
|
|
10
|
+
]
|
|
11
|
+
requires-python = ">=3.13"
|
|
12
|
+
keywords = [
|
|
13
|
+
"pyside6",
|
|
14
|
+
"qt",
|
|
15
|
+
"desktop",
|
|
16
|
+
"gui",
|
|
17
|
+
"theme",
|
|
18
|
+
"tray",
|
|
19
|
+
]
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 3 - Alpha",
|
|
22
|
+
"Environment :: X11 Applications :: Qt",
|
|
23
|
+
"Intended Audience :: Developers",
|
|
24
|
+
"Operating System :: MacOS",
|
|
25
|
+
"Operating System :: Microsoft :: Windows",
|
|
26
|
+
"Operating System :: POSIX :: Linux",
|
|
27
|
+
"Programming Language :: Python :: 3",
|
|
28
|
+
"Programming Language :: Python :: 3.13",
|
|
29
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
30
|
+
"Topic :: Software Development :: User Interfaces",
|
|
31
|
+
]
|
|
32
|
+
dependencies = [
|
|
33
|
+
"pydantic>=2.11",
|
|
34
|
+
"pyside6>=6.8",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.optional-dependencies]
|
|
38
|
+
dev = [
|
|
39
|
+
"pytest>=8.3",
|
|
40
|
+
"pytest-qt>=4.4",
|
|
41
|
+
"pyyaml>=6",
|
|
42
|
+
]
|
|
43
|
+
yaml = ["pyyaml>=6"]
|
|
44
|
+
|
|
45
|
+
[project.urls]
|
|
46
|
+
Homepage = "https://github.com/modaye/psi6"
|
|
47
|
+
Repository = "https://github.com/modaye/psi6"
|
|
48
|
+
Issues = "https://github.com/modaye/psi6/issues"
|
|
49
|
+
Changelog = "https://github.com/modaye/psi6/releases"
|
|
50
|
+
|
|
51
|
+
[project.scripts]
|
|
52
|
+
psi6 = "psi6.__main__:main"
|
|
53
|
+
|
|
54
|
+
[build-system]
|
|
55
|
+
requires = ["uv_build>=0.10.7,<0.11.0"]
|
|
56
|
+
build-backend = "uv_build"
|
|
57
|
+
|
|
58
|
+
[tool.pytest.ini_options]
|
|
59
|
+
qt_api = "pyside6"
|
|
60
|
+
testpaths = ["tests"]
|
|
61
|
+
addopts = "-q"
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"""psi6 公开 API。"""
|
|
2
|
+
|
|
3
|
+
from psi6.jobs.file_index import FILE_INDEX_COLUMNS, FileIndexParams, run_file_index
|
|
4
|
+
from psi6.runtime.app import App
|
|
5
|
+
from psi6.runtime.config import ConfigStore
|
|
6
|
+
from psi6.runtime.job import JobOutcome
|
|
7
|
+
from psi6.runtime.logs import LogLevel, LogRecord
|
|
8
|
+
from psi6.runtime.notifications import NoticeLevel, Notifier
|
|
9
|
+
from psi6.runtime.single_instance import SingleInstance
|
|
10
|
+
from psi6.runtime.tasks import TaskHandle, TaskRunner, TaskStatus
|
|
11
|
+
from psi6.templates.batch_tool import BatchToolWindow
|
|
12
|
+
from psi6.theme.paint import create_painter, mix_color, rounded_rect_path
|
|
13
|
+
from psi6.theme.tokens import DEFAULT_TOKENS, Tokens
|
|
14
|
+
from psi6.ui.action_bar import ActionBar
|
|
15
|
+
from psi6.ui.app_shell import AppShell, NavDestination
|
|
16
|
+
from psi6.ui.banner import Banner
|
|
17
|
+
from psi6.ui.busy import BusyOverlay
|
|
18
|
+
from psi6.ui.buttons import danger_button, ghost_button, link_button, primary_button, text_button
|
|
19
|
+
from psi6.ui.chat import Composer, MessageList
|
|
20
|
+
from psi6.ui.check_list import CheckItem, CheckList
|
|
21
|
+
from psi6.ui.chrome import PageHeader, StatCard
|
|
22
|
+
from psi6.ui.collapsible import Collapsible
|
|
23
|
+
from psi6.ui.command_palette import Command, CommandPalette
|
|
24
|
+
from psi6.ui.content_dialog import ContentDialog
|
|
25
|
+
from psi6.ui.data_table import DataTable, TableColumn
|
|
26
|
+
from psi6.ui.desktop_window import DesktopWindow
|
|
27
|
+
from psi6.ui.dialogs import confirm, fail, inform, warn
|
|
28
|
+
from psi6.ui.diff_view import DiffView
|
|
29
|
+
from psi6.ui.drop_zone import DropZone
|
|
30
|
+
from psi6.ui.empty_state import EmptyState
|
|
31
|
+
from psi6.ui.file_input import FileInput, FolderInput, PathState
|
|
32
|
+
from psi6.ui.filters import DebugEventFilter, PressScaleFilter, install_press_scale
|
|
33
|
+
from psi6.ui.flow_layout import FlowLayout
|
|
34
|
+
from psi6.ui.form import FormError, FormView, field_advanced, field_dir, field_file, field_secret, field_switch, pydantic_form
|
|
35
|
+
from psi6.ui.icon import Icon, IconButton
|
|
36
|
+
from psi6.ui.image_well import IconPreview, ImageWell
|
|
37
|
+
from psi6.ui.log_panel import LogPanel
|
|
38
|
+
from psi6.ui.playlist import Playlist
|
|
39
|
+
from psi6.ui.property_list import PropertyList
|
|
40
|
+
from psi6.ui.search_field import SearchField
|
|
41
|
+
from psi6.ui.section import Section
|
|
42
|
+
from psi6.ui.segmented import SegmentedControl
|
|
43
|
+
from psi6.ui.setting_row import SettingRow
|
|
44
|
+
from psi6.ui.settings_page import SettingsPage, pydantic_settings
|
|
45
|
+
from psi6.ui.status_badge import StatusBadge
|
|
46
|
+
from psi6.ui.stepper import Stepper
|
|
47
|
+
from psi6.ui.switch import Switch
|
|
48
|
+
from psi6.ui.tag import Tag, TagRow
|
|
49
|
+
from psi6.ui.task_panel import TaskPanel
|
|
50
|
+
from psi6.ui.title_bar import TitleBar
|
|
51
|
+
from psi6.ui.toast import ToastHost
|
|
52
|
+
from psi6.ui.transport import TransportBar
|
|
53
|
+
from psi6.ui.tray import TrayIcon
|
|
54
|
+
from psi6.ui.workbench import ChangeList, ChangeRow, ToolTile
|
|
55
|
+
|
|
56
|
+
__all__ = [
|
|
57
|
+
"DEFAULT_TOKENS",
|
|
58
|
+
"ActionBar",
|
|
59
|
+
"App",
|
|
60
|
+
"AppShell",
|
|
61
|
+
"Banner",
|
|
62
|
+
"BatchToolWindow",
|
|
63
|
+
"BusyOverlay",
|
|
64
|
+
"ChangeList",
|
|
65
|
+
"ChangeRow",
|
|
66
|
+
"CheckItem",
|
|
67
|
+
"CheckList",
|
|
68
|
+
"Collapsible",
|
|
69
|
+
"Command",
|
|
70
|
+
"CommandPalette",
|
|
71
|
+
"Composer",
|
|
72
|
+
"ConfigStore",
|
|
73
|
+
"ContentDialog",
|
|
74
|
+
"create_painter",
|
|
75
|
+
"DataTable",
|
|
76
|
+
"DebugEventFilter",
|
|
77
|
+
"DesktopWindow",
|
|
78
|
+
"DiffView",
|
|
79
|
+
"DropZone",
|
|
80
|
+
"EmptyState",
|
|
81
|
+
"FileInput",
|
|
82
|
+
"FlowLayout",
|
|
83
|
+
"FolderInput",
|
|
84
|
+
"FormError",
|
|
85
|
+
"FormView",
|
|
86
|
+
"FILE_INDEX_COLUMNS",
|
|
87
|
+
"FileIndexParams",
|
|
88
|
+
"Icon",
|
|
89
|
+
"IconButton",
|
|
90
|
+
"IconPreview",
|
|
91
|
+
"ImageWell",
|
|
92
|
+
"JobOutcome",
|
|
93
|
+
"LogLevel",
|
|
94
|
+
"LogPanel",
|
|
95
|
+
"LogRecord",
|
|
96
|
+
"MessageList",
|
|
97
|
+
"mix_color",
|
|
98
|
+
"NavDestination",
|
|
99
|
+
"NoticeLevel",
|
|
100
|
+
"Notifier",
|
|
101
|
+
"PageHeader",
|
|
102
|
+
"PathState",
|
|
103
|
+
"Playlist",
|
|
104
|
+
"PressScaleFilter",
|
|
105
|
+
"PropertyList",
|
|
106
|
+
"rounded_rect_path",
|
|
107
|
+
"SearchField",
|
|
108
|
+
"Section",
|
|
109
|
+
"SegmentedControl",
|
|
110
|
+
"SettingRow",
|
|
111
|
+
"SettingsPage",
|
|
112
|
+
"SingleInstance",
|
|
113
|
+
"StatCard",
|
|
114
|
+
"StatusBadge",
|
|
115
|
+
"Stepper",
|
|
116
|
+
"Switch",
|
|
117
|
+
"TableColumn",
|
|
118
|
+
"Tag",
|
|
119
|
+
"TagRow",
|
|
120
|
+
"TaskHandle",
|
|
121
|
+
"TaskPanel",
|
|
122
|
+
"TaskRunner",
|
|
123
|
+
"TaskStatus",
|
|
124
|
+
"TitleBar",
|
|
125
|
+
"ToastHost",
|
|
126
|
+
"Tokens",
|
|
127
|
+
"ToolTile",
|
|
128
|
+
"TransportBar",
|
|
129
|
+
"TrayIcon",
|
|
130
|
+
"confirm",
|
|
131
|
+
"danger_button",
|
|
132
|
+
"fail",
|
|
133
|
+
"field_advanced",
|
|
134
|
+
"field_dir",
|
|
135
|
+
"field_file",
|
|
136
|
+
"field_secret",
|
|
137
|
+
"field_switch",
|
|
138
|
+
"ghost_button",
|
|
139
|
+
"inform",
|
|
140
|
+
"install_press_scale",
|
|
141
|
+
"link_button",
|
|
142
|
+
"primary_button",
|
|
143
|
+
"pydantic_form",
|
|
144
|
+
"pydantic_settings",
|
|
145
|
+
"run_file_index",
|
|
146
|
+
"text_button",
|
|
147
|
+
"warn",
|
|
148
|
+
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""``python -m psi6`` 启动文件索引;``python -m psi6 kit`` 打开组件主题预览。"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def main() -> None:
|
|
10
|
+
"""按参数分发参考窗口。"""
|
|
11
|
+
|
|
12
|
+
if len(sys.argv) > 1 and sys.argv[1] in {"kit", "--kit"}:
|
|
13
|
+
from psi6.examples.kit import main as kit_main
|
|
14
|
+
|
|
15
|
+
kit_main()
|
|
16
|
+
return
|
|
17
|
+
if len(sys.argv) > 1 and sys.argv[1] in {"shot", "--screenshot"}:
|
|
18
|
+
from psi6.runtime.qt_env import install_qt_message_filter, prepare_qt_environment
|
|
19
|
+
|
|
20
|
+
prepare_qt_environment()
|
|
21
|
+
install_qt_message_filter()
|
|
22
|
+
os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
|
|
23
|
+
from psi6.examples.visual_qa import main as shot_main
|
|
24
|
+
|
|
25
|
+
sys.argv = [sys.argv[0], *sys.argv[2:]]
|
|
26
|
+
shot_main()
|
|
27
|
+
return
|
|
28
|
+
from psi6.examples.file_index import main as index_main
|
|
29
|
+
|
|
30
|
+
index_main()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if __name__ == "__main__":
|
|
34
|
+
main()
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""可运行参考工具:索引目录中的文件。"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from psi6.jobs.file_index import FILE_INDEX_COLUMNS, FileIndexParams, run_file_index
|
|
6
|
+
from psi6.runtime.app import App
|
|
7
|
+
from psi6.templates.batch_tool import BatchToolWindow
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main() -> None:
|
|
11
|
+
"""启动文件索引窗口。上次使用的目录会写入配置。"""
|
|
12
|
+
|
|
13
|
+
app = App("psi6-file-index")
|
|
14
|
+
window = BatchToolWindow(
|
|
15
|
+
title="psi6 文件索引",
|
|
16
|
+
params=FileIndexParams(),
|
|
17
|
+
job=run_file_index,
|
|
18
|
+
app=app,
|
|
19
|
+
result_columns=FILE_INDEX_COLUMNS,
|
|
20
|
+
icon="folder",
|
|
21
|
+
exclusive="batch",
|
|
22
|
+
)
|
|
23
|
+
raise SystemExit(app.run(window, tray=True, single_instance=True))
|