codebee 0.1.18 → 0.1.19
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.
- package/CHANGELOG.md +15 -0
- package/README.md +4 -3
- package/app/core/automation.py +19 -0
- package/app/core/backup.py +470 -0
- package/app/core/bookmeta.py +4 -1
- package/app/core/builtin_agent.py +33 -1
- package/app/core/cleanup.py +303 -0
- package/app/core/flows.py +1 -1
- package/app/core/jobs.py +22 -4
- package/app/core/knowledge.py +26 -4
- package/app/core/manager.py +25 -1
- package/app/core/market.py +14 -2
- package/app/core/modelhub.py +16 -0
- package/app/core/pipeline.py +50 -8
- package/app/core/planner.py +22 -4
- package/app/core/publish/manager.py +80 -3
- package/app/core/runner.py +127 -7
- package/app/core/selfupdate.py +80 -38
- package/app/core/settings.py +32 -1
- package/app/core/skill_scan.py +86 -0
- package/app/core/store.py +62 -8
- package/app/core/wxdigest.py +710 -0
- package/app/core/zentao.py +516 -50
- package/app/main.py +263 -1
- package/app/pet.py +1323 -0
- package/app/pet_bee.png +0 -0
- package/app/pet_bee_robot.png +0 -0
- package/app/pick_dialog.py +34 -2
- package/app/ui/app.js +11063 -10389
- package/app/ui/i18n.js +169 -9
- package/app/ui/index.html +132 -2
- package/app/ui/style.css +156 -2
- package/package.json +1 -1
package/app/pet_bee.png
ADDED
|
Binary file
|
|
Binary file
|
package/app/pick_dialog.py
CHANGED
|
@@ -47,6 +47,33 @@ def ask_directory(initial="", title="选择文件夹"):
|
|
|
47
47
|
return str(data.get("path") or ""), "", False
|
|
48
48
|
|
|
49
49
|
|
|
50
|
+
def ask_file(initial="", title="选择文件"):
|
|
51
|
+
"""父端入口:拉起子进程弹原生「选择文件」对话框(导入备份包用)。
|
|
52
|
+
返回 (path, error, fallback),语义与 ask_directory 一致。"""
|
|
53
|
+
if not Path(__file__).exists():
|
|
54
|
+
return "", "pick_dialog.py 缺失", True
|
|
55
|
+
req = json.dumps({"mode": "file", "initial": initial, "title": title}).encode("utf-8")
|
|
56
|
+
env = dict(os.environ, PYTHONIOENCODING="utf-8")
|
|
57
|
+
try:
|
|
58
|
+
if os.name == "nt":
|
|
59
|
+
cp = subprocess.run([sys.executable, _SELF], input=req,
|
|
60
|
+
capture_output=True, timeout=600, env=env,
|
|
61
|
+
creationflags=CREATE_NO_WINDOW)
|
|
62
|
+
else:
|
|
63
|
+
cp = subprocess.run([sys.executable, _SELF], input=req,
|
|
64
|
+
capture_output=True, timeout=600, env=env)
|
|
65
|
+
except Exception as e:
|
|
66
|
+
return "", str(e), True
|
|
67
|
+
if cp.returncode != 0:
|
|
68
|
+
err = (cp.stderr or b"").decode("utf-8", "replace").strip().splitlines()
|
|
69
|
+
return "", (err[-1] if err else "native picker unavailable"), True
|
|
70
|
+
try:
|
|
71
|
+
data = json.loads((cp.stdout or b"").decode("utf-8", "replace") or "{}")
|
|
72
|
+
except Exception:
|
|
73
|
+
return "", "对话框输出无法解析", True
|
|
74
|
+
return str(data.get("path") or ""), "", False
|
|
75
|
+
|
|
76
|
+
|
|
50
77
|
def main():
|
|
51
78
|
req = {}
|
|
52
79
|
try:
|
|
@@ -62,12 +89,17 @@ def main():
|
|
|
62
89
|
root.attributes("-topmost", True) # 别被全屏浏览器盖住
|
|
63
90
|
except Exception:
|
|
64
91
|
pass
|
|
65
|
-
|
|
92
|
+
is_file = req.get("mode") == "file"
|
|
93
|
+
kw = {"title": req.get("title") or ("选择文件" if is_file else "选择文件夹")}
|
|
66
94
|
init = req.get("initial") or ""
|
|
67
95
|
if init and os.path.isdir(init):
|
|
68
96
|
kw["initialdir"] = init
|
|
69
97
|
try:
|
|
70
|
-
|
|
98
|
+
if is_file:
|
|
99
|
+
kw["filetypes"] = [("备份包", "*.zip"), ("全部文件", "*.*")]
|
|
100
|
+
path = filedialog.askopenfilename(**kw) or ""
|
|
101
|
+
else:
|
|
102
|
+
path = filedialog.askdirectory(**kw) or ""
|
|
71
103
|
except Exception:
|
|
72
104
|
sys.exit(1)
|
|
73
105
|
sys.stdout.write(json.dumps({"path": path}))
|