bcmd 0.6.3__py3-none-any.whl → 0.6.5__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.
Potentially problematic release.
This version of bcmd might be problematic. Click here for more details.
- {bcmd-0.6.3.dist-info → bcmd-0.6.5.dist-info}/METADATA +2 -2
- bcmd-0.6.5.dist-info/RECORD +29 -0
- bcmd-0.6.5.dist-info/entry_points.txt +2 -0
- bcmd-0.6.5.dist-info/top_level.txt +1 -0
- {bcmd → bcmdx}/common/func.py +1 -1
- bcmdx/tasks/lib.py +93 -0
- {bcmd → bcmdx}/tasks/upgrade.py +1 -1
- bcmdx/utils/__init__.py +0 -0
- bcmdx/utils/tkUtil.py +130 -0
- bcmd/resources/project/.gitignore +0 -3
- bcmd/resources/project/.vscode/launch.json +0 -15
- bcmd/resources/project/.vscode/settings.json +0 -11
- bcmd/resources/project/.vscode/tasks.json +0 -68
- bcmd/tasks/lib.py +0 -58
- bcmd-0.6.3.dist-info/RECORD +0 -31
- bcmd-0.6.3.dist-info/entry_points.txt +0 -2
- bcmd-0.6.3.dist-info/top_level.txt +0 -1
- {bcmd-0.6.3.dist-info → bcmd-0.6.5.dist-info}/WHEEL +0 -0
- {bcmd → bcmdx}/__init__.py +0 -0
- {bcmd → bcmdx}/common/__init__.py +0 -0
- {bcmd → bcmdx}/common/password.py +0 -0
- {bcmd → bcmdx}/main.py +0 -0
- {bcmd → bcmdx}/resources/project/main.py +0 -0
- {bcmd → bcmdx}/tasks/__init__.py +0 -0
- {bcmd → bcmdx}/tasks/bin.py +0 -0
- {bcmd → bcmdx}/tasks/code.py +0 -0
- {bcmd → bcmdx}/tasks/crypto.py +0 -0
- {bcmd → bcmdx}/tasks/debian.py +0 -0
- {bcmd → bcmdx}/tasks/download.py +0 -0
- {bcmd → bcmdx}/tasks/image.py +0 -0
- {bcmd → bcmdx}/tasks/json.py +0 -0
- {bcmd → bcmdx}/tasks/math.py +0 -0
- {bcmd → bcmdx}/tasks/mirror.py +0 -0
- {bcmd → bcmdx}/tasks/pdf.py +0 -0
- {bcmd → bcmdx}/tasks/proxy.py +0 -0
- {bcmd → bcmdx}/tasks/time.py +0 -0
- {bcmd → bcmdx}/tasks/wasabi.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bcmd
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.5
|
|
4
4
|
Summary: Commands for Beni
|
|
5
5
|
Author-email: Beni Mang <benimang@126.com>
|
|
6
6
|
Maintainer-email: Beni Mang <benimang@126.com>
|
|
@@ -8,7 +8,7 @@ Keywords: benimang,beni,bcmd
|
|
|
8
8
|
Requires-Python: >=3.10
|
|
9
9
|
Requires-Dist: aioconsole==0.8.1
|
|
10
10
|
Requires-Dist: async-lru==2.0.5
|
|
11
|
-
Requires-Dist: benimang==0.8.
|
|
11
|
+
Requires-Dist: benimang==0.8.1
|
|
12
12
|
Requires-Dist: cryptography==45.0.4
|
|
13
13
|
Requires-Dist: nest-asyncio==1.6.0
|
|
14
14
|
Requires-Dist: pillow==11.2.1
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
bcmdx/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
bcmdx/main.py,sha256=GP_60-6vImXqdMfC5vc4xlscWajx4OYmnlNXASWn19w,147
|
|
3
|
+
bcmdx/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
bcmdx/common/func.py,sha256=MB_ChA4aRzEjhMhyFmZ-h8aOZePzk0poYcTYRJUQxmI,509
|
|
5
|
+
bcmdx/common/password.py,sha256=2oxHvsCL05lNBpDJ8hbx4LPadDsZQKds4f0rJBYTNHA,1368
|
|
6
|
+
bcmdx/resources/project/main.py,sha256=xdskz_sf05fYA1SRMFCIxDjx8SnegxTbCmHpW86ItLs,11
|
|
7
|
+
bcmdx/tasks/__init__.py,sha256=lcVrTgdEph3tKBwwCPVyEOHp-1A3zdFA_6OWLrOo19M,314
|
|
8
|
+
bcmdx/tasks/bin.py,sha256=B_e-HYOc2Cohk-1PbKHyKn3RhI8TAUfI2EBRoFEHiTM,2961
|
|
9
|
+
bcmdx/tasks/code.py,sha256=IUs_ClZuSsBk2gavlitC8mkRrQQX9rvNDgR8cFxduBA,3992
|
|
10
|
+
bcmdx/tasks/crypto.py,sha256=LKvgsMPLvsi1wlt66TinYiN-oV2IPAfaN9y7hWaVpHs,2951
|
|
11
|
+
bcmdx/tasks/debian.py,sha256=B9aMIIct3vNqMJr5hTr1GegXVf20H49C27FMvRRGIzI,3004
|
|
12
|
+
bcmdx/tasks/download.py,sha256=XdZYKi8zQTNYWEgUxeTNDqPgP7IGYJkMmlDDC9u93Vk,2315
|
|
13
|
+
bcmdx/tasks/image.py,sha256=Q8ujT6tq2tt0qS0DIY87PNG2RJ1wSArt2dHVTtCuccA,12161
|
|
14
|
+
bcmdx/tasks/json.py,sha256=WWOyvcZPYaqQgp-Tkm-uIJschNMBKPKtZN3yXz_SC5s,635
|
|
15
|
+
bcmdx/tasks/lib.py,sha256=4Ge0DQe4J7hyg2S-kJQ22MDbvO-E7BoyM00etNsxowc,2751
|
|
16
|
+
bcmdx/tasks/math.py,sha256=xbl5UdaDMyAjiLodDPleP4Cutrk2S3NOAgurzAgOEAE,2862
|
|
17
|
+
bcmdx/tasks/mirror.py,sha256=nAe8NYftMKzht16MFBj7RqXwvVhR6Jh2uuAyJLh87og,1098
|
|
18
|
+
bcmdx/tasks/pdf.py,sha256=fkHRgxqzrRxdb4_-9pL9wp2roqAHJPS_dVqAGJvRUsM,1504
|
|
19
|
+
bcmdx/tasks/proxy.py,sha256=xvxN5PClUnc5LQpmq2Wug7_LUVpJboMWLXBvL9lX7EM,1552
|
|
20
|
+
bcmdx/tasks/time.py,sha256=ZiqA1jdgl-TBtFSOxxP51nwv4g9iZItmkFKpf9MKelk,2453
|
|
21
|
+
bcmdx/tasks/upgrade.py,sha256=z9Ein8U_Co7fsijPxyDFM8tXBFCp4bWATImwwwvC5ho,536
|
|
22
|
+
bcmdx/tasks/wasabi.py,sha256=xWFAxprSIlBqDDMGaNXZFb-SahnW1d_R9XxSKRYIhnM,3110
|
|
23
|
+
bcmdx/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
+
bcmdx/utils/tkUtil.py,sha256=Juj0be7i3wCBIZBFic4ye76ZfsVLkFiw50J266e5-0U,4685
|
|
25
|
+
bcmd-0.6.5.dist-info/METADATA,sha256=O89LvsZh4ht3n6a15QOaAqzN6_eJd5PKZ1QnS3FOjNU,812
|
|
26
|
+
bcmd-0.6.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
bcmd-0.6.5.dist-info/entry_points.txt,sha256=p7bvtyio57ADkhcYAQeVus3iwXlSlcUwmuLtyR2qslQ,40
|
|
28
|
+
bcmd-0.6.5.dist-info/top_level.txt,sha256=rFHAQCIe-D-4iY7llhCS6cRDYfRIhHh9knGydcCiQjQ,6
|
|
29
|
+
bcmd-0.6.5.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bcmdx
|
{bcmd → bcmdx}/common/func.py
RENAMED
bcmdx/tasks/lib.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Final
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
from beni import bcolor, bfile, bpath, brun, btask
|
|
7
|
+
from beni.bfunc import syncCall
|
|
8
|
+
|
|
9
|
+
from bcmdx.utils.tkUtil import TkForm
|
|
10
|
+
|
|
11
|
+
from ..common import password
|
|
12
|
+
|
|
13
|
+
app: Final = btask.newSubApp('lib 工具')
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@app.command()
|
|
17
|
+
@syncCall
|
|
18
|
+
async def update_version(
|
|
19
|
+
path: Path = typer.Argument(Path.cwd(), help='workspace 路径'),
|
|
20
|
+
isNotCommit: bool = typer.Option(False, '--no-commit', '-d', help='是否提交git'),
|
|
21
|
+
):
|
|
22
|
+
'修改 pyproject.toml 版本号'
|
|
23
|
+
file = path / 'pyproject.toml'
|
|
24
|
+
btask.assertTrue(file.is_file(), '文件不存在', file)
|
|
25
|
+
data = await bfile.readToml(file)
|
|
26
|
+
latestVersion = data['project']['version']
|
|
27
|
+
vAry = [int(x) for x in latestVersion.split('.')]
|
|
28
|
+
versionList = [
|
|
29
|
+
f'{vAry[0] + 1}.0.0',
|
|
30
|
+
f'{vAry[0]}.{vAry[1] + 1}.0',
|
|
31
|
+
f'{vAry[0]}.{vAry[1]}.{vAry[2] + 1}',
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
def showGui():
|
|
35
|
+
app = TkForm()
|
|
36
|
+
app.title('bcmd 版本更新')
|
|
37
|
+
app.addLabel('当前版本号', latestVersion)
|
|
38
|
+
version_var = app.addRadioBtn(
|
|
39
|
+
'请选择新版本',
|
|
40
|
+
versionList,
|
|
41
|
+
selectedIndex=-1,
|
|
42
|
+
)
|
|
43
|
+
result: str = ''
|
|
44
|
+
|
|
45
|
+
def onBtn():
|
|
46
|
+
nonlocal result
|
|
47
|
+
result = version_var.get()
|
|
48
|
+
app.destroy()
|
|
49
|
+
|
|
50
|
+
app.addBtn('确定', onBtn, focus=True)
|
|
51
|
+
app.run()
|
|
52
|
+
return result
|
|
53
|
+
|
|
54
|
+
newVersion = showGui()
|
|
55
|
+
if not newVersion:
|
|
56
|
+
btask.abort('用户取消操作')
|
|
57
|
+
content = await bfile.readText(file)
|
|
58
|
+
if f"version = '{latestVersion}'" in content:
|
|
59
|
+
content = content.replace(f"version = '{latestVersion}'", f"version = '{newVersion}'")
|
|
60
|
+
elif f'version = "{latestVersion}"' in content:
|
|
61
|
+
content = content.replace(f'version = "{latestVersion}"', f'version = "{newVersion}"')
|
|
62
|
+
else:
|
|
63
|
+
raise Exception('版本号修改失败,先检查文件中定义的版本号格式是否正常')
|
|
64
|
+
await bfile.writeText(file, content)
|
|
65
|
+
|
|
66
|
+
# 执行一遍 uv.lock
|
|
67
|
+
with bpath.changePath(path):
|
|
68
|
+
await brun.run('uv lock')
|
|
69
|
+
|
|
70
|
+
bcolor.printCyan(newVersion)
|
|
71
|
+
if not isNotCommit:
|
|
72
|
+
msg = f'更新版本号 {newVersion}'
|
|
73
|
+
os.system(
|
|
74
|
+
rf'TortoiseGitProc.exe /command:commit /path:{path} /logmsg:"{msg}"'
|
|
75
|
+
)
|
|
76
|
+
bcolor.printGreen('OK')
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@app.command()
|
|
80
|
+
@syncCall
|
|
81
|
+
async def build(
|
|
82
|
+
path: Path = typer.Argument(Path.cwd(), help='workspace 路径'),
|
|
83
|
+
):
|
|
84
|
+
'发布项目'
|
|
85
|
+
user, pwd = await password.getPypi()
|
|
86
|
+
bpath.remove(path / 'dist')
|
|
87
|
+
bpath.remove(
|
|
88
|
+
*list(path.glob('*.egg-info'))
|
|
89
|
+
)
|
|
90
|
+
with bpath.changePath(path):
|
|
91
|
+
await brun.run(f'uv build')
|
|
92
|
+
await brun.run(f'uv publish -u {user} -p {pwd}')
|
|
93
|
+
bcolor.printGreen('OK')
|
{bcmd → bcmdx}/tasks/upgrade.py
RENAMED
bcmdx/utils/__init__.py
ADDED
|
File without changes
|
bcmdx/utils/tkUtil.py
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import tkinter as tk
|
|
2
|
+
from tkinter.scrolledtext import ScrolledText
|
|
3
|
+
from typing import Callable
|
|
4
|
+
from uuid import uuid4
|
|
5
|
+
|
|
6
|
+
# version 2026-0621
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TkForm(tk.Tk):
|
|
10
|
+
|
|
11
|
+
_row = -1
|
|
12
|
+
_initFocusItem: tk.Widget | None = None
|
|
13
|
+
|
|
14
|
+
RADIO_NOTHING = uuid4().hex
|
|
15
|
+
|
|
16
|
+
def __init__(self):
|
|
17
|
+
super().__init__()
|
|
18
|
+
self.resizable(False, False)
|
|
19
|
+
self.bind("<Map>", self._onMap)
|
|
20
|
+
|
|
21
|
+
def _onMap(self, event: tk.Event):
|
|
22
|
+
if self._initFocusItem:
|
|
23
|
+
self._initFocusItem.focus_set()
|
|
24
|
+
self._initFocusItem = None
|
|
25
|
+
|
|
26
|
+
def add(self, desc: str, widget: tk.Widget):
|
|
27
|
+
self._row += 1
|
|
28
|
+
tk.Label(text=desc).grid(row=self._row, column=0, padx=10, pady=5, sticky='n')
|
|
29
|
+
widget.grid(row=self._row, column=1, padx=10, pady=5, sticky='w')
|
|
30
|
+
|
|
31
|
+
def addFrame(self, frame: tk.Frame):
|
|
32
|
+
self._row += 1
|
|
33
|
+
frame.grid(row=self._row, column=0, columnspan=2, padx=10, pady=5)
|
|
34
|
+
|
|
35
|
+
def run(self):
|
|
36
|
+
self.center()
|
|
37
|
+
self.mainloop()
|
|
38
|
+
|
|
39
|
+
def center(self):
|
|
40
|
+
self.withdraw() # 先隐藏窗口,避免闪动
|
|
41
|
+
self.update_idletasks() # 确保获取正确的窗口尺寸
|
|
42
|
+
width = self.winfo_width() # 获取窗口宽度
|
|
43
|
+
height = self.winfo_height() # 获取窗口高度
|
|
44
|
+
screen_width = self.winfo_screenwidth() # 屏幕宽度
|
|
45
|
+
screen_height = self.winfo_screenheight() # 屏幕高度
|
|
46
|
+
x = (screen_width - width) // 2 # 水平居中
|
|
47
|
+
y = (screen_height - height) // 2 # 垂直居中
|
|
48
|
+
self.geometry(f"+{x}+{y}") # 设置窗口位置
|
|
49
|
+
self.deiconify() # 恢复显示窗口
|
|
50
|
+
|
|
51
|
+
def addLabel(self, desc: str, text: str):
|
|
52
|
+
self.add(desc, tk.Label(text=text))
|
|
53
|
+
|
|
54
|
+
def addBtn(self, label: str, command: Callable[..., None], *, width: int = 20, focus: bool = False):
|
|
55
|
+
frame = tk.Frame(self)
|
|
56
|
+
self.addFrame(frame)
|
|
57
|
+
btn = tk.Button(frame, text=label, width=width, command=command)
|
|
58
|
+
btn.pack(side="left", expand=True, padx=15)
|
|
59
|
+
if focus:
|
|
60
|
+
self._initFocusItem = btn
|
|
61
|
+
|
|
62
|
+
def addRadioBtn(self, desc: str, selectionList: list[str], *, selectedIndex: int | None = None, focusIndex: int | None = None):
|
|
63
|
+
frame = tk.Frame()
|
|
64
|
+
self.add(desc, frame)
|
|
65
|
+
var = tk.StringVar(value=selectionList[selectedIndex] if selectedIndex is not None else self.RADIO_NOTHING)
|
|
66
|
+
radioBtnList: list[tk.Radiobutton] = []
|
|
67
|
+
for version in selectionList:
|
|
68
|
+
radioBtn = tk.Radiobutton(frame, text=version, variable=var, value=version)
|
|
69
|
+
radioBtn.pack(side="left", padx=(0, 15))
|
|
70
|
+
radioBtnList.append(radioBtn)
|
|
71
|
+
if focusIndex is not None:
|
|
72
|
+
self._initFocusItem = radioBtnList[focusIndex]
|
|
73
|
+
return var
|
|
74
|
+
|
|
75
|
+
def addEntry(self, desc: str, text: str = '', *, width: int = 60, focus: bool = False):
|
|
76
|
+
entry = tk.Entry(self, width=30)
|
|
77
|
+
entry.insert(0, text)
|
|
78
|
+
self.add(desc, entry)
|
|
79
|
+
if focus:
|
|
80
|
+
self._initFocusItem = entry
|
|
81
|
+
return entry
|
|
82
|
+
|
|
83
|
+
def addScrolledText(self, desc: str, text: str = '', *, width: int = 60, height: int = 20, focus: bool = False):
|
|
84
|
+
scrolledText = ScrolledText(self, width=width, height=height)
|
|
85
|
+
scrolledText.insert("1.0", text)
|
|
86
|
+
self.add(desc, scrolledText)
|
|
87
|
+
if focus:
|
|
88
|
+
self._initFocusItem = scrolledText
|
|
89
|
+
return scrolledText
|
|
90
|
+
|
|
91
|
+
def addCheckBox(self, text: str, value: bool = False):
|
|
92
|
+
remember_var = tk.BooleanVar(value=value)
|
|
93
|
+
check_btn = tk.Checkbutton(text=text, variable=remember_var)
|
|
94
|
+
self.add("", check_btn)
|
|
95
|
+
return remember_var
|
|
96
|
+
|
|
97
|
+
def addPasswordInput(self, desc: str, *, width: int = 60, command: Callable[..., None] | None = None):
|
|
98
|
+
password_entry = tk.Entry(self, show="*", width=width) # 使用 show="*" 隐藏输入内容
|
|
99
|
+
if command:
|
|
100
|
+
password_entry.bind('<Return>', lambda event: command())
|
|
101
|
+
self.add(desc, password_entry)
|
|
102
|
+
return password_entry
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
''' 例子
|
|
106
|
+
app = TkForm()
|
|
107
|
+
app.title('更新版本信息')
|
|
108
|
+
app.addLabel('当前版本号', '3.11.8')
|
|
109
|
+
app.addLabel('上次更新时间', '2025-06-16 16:00:00')
|
|
110
|
+
version_var = app.addRadioBtn(
|
|
111
|
+
'请选择新版本',
|
|
112
|
+
['3.11.8', '3.11.9', '3.11.10'],
|
|
113
|
+
2,
|
|
114
|
+
)
|
|
115
|
+
log_text = app.addScrolledText('更新日志', '123\n23454asd这个')
|
|
116
|
+
vara = app.addCheckBox('记住密码', False)
|
|
117
|
+
varb = app.addCheckBox('阿萨德法师大润发', True)
|
|
118
|
+
passwordInput = app.addPasswordInput('密码', command=lambda: onBtn())
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def onBtn():
|
|
122
|
+
print(version_var.get())
|
|
123
|
+
print(log_text.get('1.0', "end-1c").split('\n'))
|
|
124
|
+
app.destroy()
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
app.addBtn('确定', onBtn)
|
|
128
|
+
app.bind("<Visibility>", lambda e: passwordInput.focus_set())
|
|
129
|
+
app.run()
|
|
130
|
+
'''
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"configurations": [
|
|
7
|
-
{
|
|
8
|
-
"name": "Python: main.py",
|
|
9
|
-
"type": "debugpy",
|
|
10
|
-
"request": "launch",
|
|
11
|
-
// "console": "internalConsole",
|
|
12
|
-
"program": "${workspaceFolder}/main.py"
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "2.0.0",
|
|
3
|
-
"tasks": [
|
|
4
|
-
{
|
|
5
|
-
"label": "git commit",
|
|
6
|
-
"problemMatcher": [],
|
|
7
|
-
"command": "TortoiseGitProc.exe",
|
|
8
|
-
"args": [
|
|
9
|
-
"/command:commit",
|
|
10
|
-
"/path:${workspaceFolder}/",
|
|
11
|
-
],
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"label": "git commit file",
|
|
15
|
-
"problemMatcher": [],
|
|
16
|
-
"command": "TortoiseGitProc.exe",
|
|
17
|
-
"args": [
|
|
18
|
-
"/command:commit",
|
|
19
|
-
"/path:${file}",
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"label": "git revert",
|
|
24
|
-
"problemMatcher": [],
|
|
25
|
-
"command": "TortoiseGitProc.exe",
|
|
26
|
-
"args": [
|
|
27
|
-
"/command:revert",
|
|
28
|
-
"/path:${workspaceFolder}/",
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"label": "git revert file",
|
|
33
|
-
"problemMatcher": [],
|
|
34
|
-
"command": "TortoiseGitProc.exe",
|
|
35
|
-
"args": [
|
|
36
|
-
"/command:revert",
|
|
37
|
-
"/path:${file}",
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"label": "git sync",
|
|
42
|
-
"problemMatcher": [],
|
|
43
|
-
"command": "TortoiseGitProc.exe",
|
|
44
|
-
"args": [
|
|
45
|
-
"/command:sync",
|
|
46
|
-
"/path:${workspaceFolder}/",
|
|
47
|
-
],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"label": "git log",
|
|
51
|
-
"problemMatcher": [],
|
|
52
|
-
"command": "TortoiseGitProc.exe",
|
|
53
|
-
"args": [
|
|
54
|
-
"/command:log",
|
|
55
|
-
"/path:${workspaceFolder}/",
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"label": "git log file",
|
|
60
|
-
"problemMatcher": [],
|
|
61
|
-
"command": "TortoiseGitProc.exe",
|
|
62
|
-
"args": [
|
|
63
|
-
"/command:log",
|
|
64
|
-
"/path:${file}",
|
|
65
|
-
],
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
}
|
bcmd/tasks/lib.py
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
from typing import Final
|
|
4
|
-
|
|
5
|
-
import typer
|
|
6
|
-
from beni import bcolor, bfile, bpath, brun, btask
|
|
7
|
-
from beni.bfunc import syncCall
|
|
8
|
-
|
|
9
|
-
from ..common import password
|
|
10
|
-
|
|
11
|
-
app: Final = btask.newSubApp('lib 工具')
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@app.command()
|
|
15
|
-
@syncCall
|
|
16
|
-
async def update_version(
|
|
17
|
-
path: Path = typer.Argument(Path.cwd(), help='workspace 路径'),
|
|
18
|
-
isNotCommit: bool = typer.Option(False, '--no-commit', '-d', help='是否提交git'),
|
|
19
|
-
):
|
|
20
|
-
'修改 pyproject.toml 版本号'
|
|
21
|
-
file = path / 'pyproject.toml'
|
|
22
|
-
btask.assertTrue(file.is_file(), '文件不存在', file)
|
|
23
|
-
data = await bfile.readToml(file)
|
|
24
|
-
version = data['project']['version']
|
|
25
|
-
versionList = [int(x) for x in version.split('.')]
|
|
26
|
-
versionList[-1] += 1
|
|
27
|
-
newVersion = '.'.join([str(x) for x in versionList])
|
|
28
|
-
content = await bfile.readText(file)
|
|
29
|
-
if f"version = '{version}'" in content:
|
|
30
|
-
content = content.replace(f"version = '{version}'", f"version = '{newVersion}'")
|
|
31
|
-
elif f'version = "{version}"' in content:
|
|
32
|
-
content = content.replace(f'version = "{version}"', f'version = "{newVersion}"')
|
|
33
|
-
else:
|
|
34
|
-
raise Exception('版本号修改失败,先检查文件中定义的版本号格式是否正常')
|
|
35
|
-
await bfile.writeText(file, content)
|
|
36
|
-
bcolor.printCyan(newVersion)
|
|
37
|
-
if not isNotCommit:
|
|
38
|
-
msg = f'更新版本号 {newVersion}'
|
|
39
|
-
os.system(
|
|
40
|
-
rf'TortoiseGitProc.exe /command:commit /path:{file} /logmsg:"{msg}"'
|
|
41
|
-
)
|
|
42
|
-
bcolor.printGreen('OK')
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
@app.command()
|
|
46
|
-
@syncCall
|
|
47
|
-
async def build(
|
|
48
|
-
path: Path = typer.Argument(Path.cwd(), help='workspace 路径'),
|
|
49
|
-
):
|
|
50
|
-
'发布项目'
|
|
51
|
-
user, pwd = await password.getPypi()
|
|
52
|
-
bpath.remove(path / 'dist')
|
|
53
|
-
bpath.remove(
|
|
54
|
-
*list(path.glob('*.egg-info'))
|
|
55
|
-
)
|
|
56
|
-
with bpath.changePath(path):
|
|
57
|
-
await brun.run(f'uv build', isPrint=True)
|
|
58
|
-
await brun.run(f'uv publish -u {user} -p {pwd}', isPrint=True)
|
bcmd-0.6.3.dist-info/RECORD
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
bcmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
bcmd/main.py,sha256=GP_60-6vImXqdMfC5vc4xlscWajx4OYmnlNXASWn19w,147
|
|
3
|
-
bcmd/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
bcmd/common/func.py,sha256=MehbfuWFHTOsihhYxVFj0_U6-hjMTfLh3n-oMrpyyKo,508
|
|
5
|
-
bcmd/common/password.py,sha256=2oxHvsCL05lNBpDJ8hbx4LPadDsZQKds4f0rJBYTNHA,1368
|
|
6
|
-
bcmd/resources/project/.gitignore,sha256=EygWFLwtooQl0GWXSeaLszLT-yQioKM7YMNAidcAHGw,23
|
|
7
|
-
bcmd/resources/project/main.py,sha256=xdskz_sf05fYA1SRMFCIxDjx8SnegxTbCmHpW86ItLs,11
|
|
8
|
-
bcmd/resources/project/.vscode/launch.json,sha256=Wpghb9lW9Y1wtrjqlTbyjeejDuU8BQJmBjwsLyPRh1g,478
|
|
9
|
-
bcmd/resources/project/.vscode/settings.json,sha256=G4rCroWxEHcQfsqIJ6CXRHI6VGr3WYQI3KPPjH_JANs,280
|
|
10
|
-
bcmd/resources/project/.vscode/tasks.json,sha256=gouhpkrqiPz7v65Jw1Rz-BCYU3sSdmphzXIYCzVnoe0,1783
|
|
11
|
-
bcmd/tasks/__init__.py,sha256=lcVrTgdEph3tKBwwCPVyEOHp-1A3zdFA_6OWLrOo19M,314
|
|
12
|
-
bcmd/tasks/bin.py,sha256=B_e-HYOc2Cohk-1PbKHyKn3RhI8TAUfI2EBRoFEHiTM,2961
|
|
13
|
-
bcmd/tasks/code.py,sha256=IUs_ClZuSsBk2gavlitC8mkRrQQX9rvNDgR8cFxduBA,3992
|
|
14
|
-
bcmd/tasks/crypto.py,sha256=LKvgsMPLvsi1wlt66TinYiN-oV2IPAfaN9y7hWaVpHs,2951
|
|
15
|
-
bcmd/tasks/debian.py,sha256=B9aMIIct3vNqMJr5hTr1GegXVf20H49C27FMvRRGIzI,3004
|
|
16
|
-
bcmd/tasks/download.py,sha256=XdZYKi8zQTNYWEgUxeTNDqPgP7IGYJkMmlDDC9u93Vk,2315
|
|
17
|
-
bcmd/tasks/image.py,sha256=Q8ujT6tq2tt0qS0DIY87PNG2RJ1wSArt2dHVTtCuccA,12161
|
|
18
|
-
bcmd/tasks/json.py,sha256=WWOyvcZPYaqQgp-Tkm-uIJschNMBKPKtZN3yXz_SC5s,635
|
|
19
|
-
bcmd/tasks/lib.py,sha256=dzb1VaVkVMtI586pqIoqp5jEhY0KcZkIbz5BIZJh7vY,1932
|
|
20
|
-
bcmd/tasks/math.py,sha256=xbl5UdaDMyAjiLodDPleP4Cutrk2S3NOAgurzAgOEAE,2862
|
|
21
|
-
bcmd/tasks/mirror.py,sha256=nAe8NYftMKzht16MFBj7RqXwvVhR6Jh2uuAyJLh87og,1098
|
|
22
|
-
bcmd/tasks/pdf.py,sha256=fkHRgxqzrRxdb4_-9pL9wp2roqAHJPS_dVqAGJvRUsM,1504
|
|
23
|
-
bcmd/tasks/proxy.py,sha256=xvxN5PClUnc5LQpmq2Wug7_LUVpJboMWLXBvL9lX7EM,1552
|
|
24
|
-
bcmd/tasks/time.py,sha256=ZiqA1jdgl-TBtFSOxxP51nwv4g9iZItmkFKpf9MKelk,2453
|
|
25
|
-
bcmd/tasks/upgrade.py,sha256=2Wu_aFn-UcToNPDzjRG78VSChirEiD2KnAf6fJUgYak,535
|
|
26
|
-
bcmd/tasks/wasabi.py,sha256=xWFAxprSIlBqDDMGaNXZFb-SahnW1d_R9XxSKRYIhnM,3110
|
|
27
|
-
bcmd-0.6.3.dist-info/METADATA,sha256=DNPenlEJcwpllXjMXn9Oi4RPJWpX28dPKieUiEamwjE,812
|
|
28
|
-
bcmd-0.6.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
29
|
-
bcmd-0.6.3.dist-info/entry_points.txt,sha256=rHJrP6KEQpB-YaQqDFzEL2v88r03rxSfnzAayRvAqHU,39
|
|
30
|
-
bcmd-0.6.3.dist-info/top_level.txt,sha256=-KrvhhtBcYsm4XhcjQvEcFbBB3VXeep7d3NIfDTrXKQ,5
|
|
31
|
-
bcmd-0.6.3.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bcmd
|
|
File without changes
|
{bcmd → bcmdx}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bcmd → bcmdx}/main.py
RENAMED
|
File without changes
|
|
File without changes
|
{bcmd → bcmdx}/tasks/__init__.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/bin.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/code.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/crypto.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/debian.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/download.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/image.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/json.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/math.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/mirror.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/pdf.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/proxy.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/time.py
RENAMED
|
File without changes
|
{bcmd → bcmdx}/tasks/wasabi.py
RENAMED
|
File without changes
|