bcmd 0.6.17__tar.gz → 0.6.19__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.
Potentially problematic release.
This version of bcmd might be problematic. Click here for more details.
- {bcmd-0.6.17 → bcmd-0.6.19}/PKG-INFO +2 -2
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/__init__.py +1 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/docs.py +6 -13
- bcmd-0.6.19/bcmd/tasks/project.py +34 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd.egg-info/PKG-INFO +2 -2
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd.egg-info/SOURCES.txt +3 -3
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd.egg-info/requires.txt +1 -1
- {bcmd-0.6.17 → bcmd-0.6.19}/pyproject.toml +2 -2
- bcmd-0.6.17/bcmd/utils/utils.py +0 -9
- {bcmd-0.6.17 → bcmd-0.6.19}/MANIFEST.in +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/README.md +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/__init__.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/common/__init__.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/common/func.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/common/secret.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/resources/project/main.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/bin.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/code.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/crypto.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/download.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/image.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/json.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/lib.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/math.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/mirror.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/pdf.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/proxy.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/time.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/upgrade.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/tasks/wasabi.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd/utils/__init__.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd.egg-info/dependency_links.txt +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd.egg-info/entry_points.txt +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/bcmd.egg-info/top_level.txt +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/setup.cfg +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/test/__init__.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/test/conftest.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/test/test_pdf.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/test/test_proxy.py +0 -0
- {bcmd-0.6.17 → bcmd-0.6.19}/test/test_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.19
|
|
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.9
|
|
12
12
|
Requires-Dist: cryptography==45.0.4
|
|
13
13
|
Requires-Dist: nest-asyncio==1.6.0
|
|
14
14
|
Requires-Dist: paramiko==3.5.1
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import asyncio
|
|
2
1
|
import datetime
|
|
2
|
+
import json
|
|
3
3
|
import pickle
|
|
4
4
|
import tkinter as tk
|
|
5
5
|
from contextlib import asynccontextmanager
|
|
@@ -14,8 +14,6 @@ from beni.bform import BForm
|
|
|
14
14
|
from beni.bfunc import syncCall
|
|
15
15
|
from typer import Argument
|
|
16
16
|
|
|
17
|
-
from bcmd.utils.utils import decryptFileIgnoreError
|
|
18
|
-
|
|
19
17
|
app: Final = btask.newSubApp('Vitepress 网站相关')
|
|
20
18
|
conf: dict[str, Any] = {}
|
|
21
19
|
isUpload: bool = False
|
|
@@ -90,7 +88,7 @@ async def userInput():
|
|
|
90
88
|
def onBtn(self):
|
|
91
89
|
password = self.varPassword.get()
|
|
92
90
|
try:
|
|
93
|
-
|
|
91
|
+
bcrypto.decryptJson(conf['server_info'], password)
|
|
94
92
|
self.destroy()
|
|
95
93
|
except:
|
|
96
94
|
messagebox.showerror('密码错误', '密码错误,请重新输入')
|
|
@@ -103,12 +101,10 @@ async def userInput():
|
|
|
103
101
|
btask.abort('用户取消操作')
|
|
104
102
|
isUpload, password = result
|
|
105
103
|
|
|
106
|
-
#
|
|
104
|
+
# 将里面加密的内容解密
|
|
107
105
|
for k, v in conf.items():
|
|
108
|
-
|
|
106
|
+
if str(v).startswith(bcrypto.FLAG):
|
|
109
107
|
conf[k] = bcrypto.decryptText(v, password)
|
|
110
|
-
except:
|
|
111
|
-
pass
|
|
112
108
|
|
|
113
109
|
|
|
114
110
|
async def vitepressBuild(outputPath: Path):
|
|
@@ -131,7 +127,6 @@ async def makeDeploy(outputPath: Path):
|
|
|
131
127
|
|
|
132
128
|
# 文件名以及内容调整
|
|
133
129
|
fileList = bpath.listFile(outputPath, True)
|
|
134
|
-
await asyncio.gather(*[decryptFileIgnoreError(x, password) for x in fileList])
|
|
135
130
|
for file in fileList:
|
|
136
131
|
|
|
137
132
|
# 替换文件名
|
|
@@ -145,10 +140,8 @@ async def makeDeploy(outputPath: Path):
|
|
|
145
140
|
# 替换文件内容
|
|
146
141
|
content = await bfile.readText(file)
|
|
147
142
|
oldContent = content
|
|
148
|
-
|
|
143
|
+
if content.startswith(bcrypto.FLAG):
|
|
149
144
|
content = bcrypto.decryptText(content, password)
|
|
150
|
-
except:
|
|
151
|
-
pass
|
|
152
145
|
for k, v in dataDict.items():
|
|
153
146
|
content = content.replace(f'{{{k}}}', str(v))
|
|
154
147
|
if oldContent != content:
|
|
@@ -168,7 +161,7 @@ async def sshClient():
|
|
|
168
161
|
with bpath.useTempFile() as tempFile:
|
|
169
162
|
await bfile.writeText(tempFile, conf['server_key'])
|
|
170
163
|
client.connect(
|
|
171
|
-
**conf['server_info'],
|
|
164
|
+
**json.loads(conf['server_info']),
|
|
172
165
|
key_filename=str(tempFile),
|
|
173
166
|
)
|
|
174
167
|
yield client
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Final
|
|
4
|
+
|
|
5
|
+
from beni import btask, bpath
|
|
6
|
+
from beni.bfunc import syncCall
|
|
7
|
+
from typer import Argument, Option
|
|
8
|
+
|
|
9
|
+
app: Final = btask.newSubApp('项目相关')
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@app.command()
|
|
13
|
+
@syncCall
|
|
14
|
+
async def init(
|
|
15
|
+
path: Path = Argument(Path.cwd(), help='workspace 路径'),
|
|
16
|
+
deep: int = Option(3, '--deep', '-d', help='探索深度'),
|
|
17
|
+
):
|
|
18
|
+
'找出项目执行初始化 pnpm install 和 uv sync --all-extras'
|
|
19
|
+
|
|
20
|
+
initSubFolder(path, deep)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def initSubFolder(path: Path, deep: int):
|
|
24
|
+
uvLockFile = path / 'uv.lock'
|
|
25
|
+
pnpmLockFile = path / 'pnpm-lock.yaml'
|
|
26
|
+
if uvLockFile.exists():
|
|
27
|
+
with bpath.changePath(path):
|
|
28
|
+
os.system('uv sync --all-extras')
|
|
29
|
+
elif pnpmLockFile.exists():
|
|
30
|
+
with bpath.changePath(path):
|
|
31
|
+
os.system('pnpm install')
|
|
32
|
+
elif deep > 1:
|
|
33
|
+
for subPath in bpath.listDir(path):
|
|
34
|
+
initSubFolder(subPath, deep - 1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bcmd
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.19
|
|
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.9
|
|
12
12
|
Requires-Dist: cryptography==45.0.4
|
|
13
13
|
Requires-Dist: nest-asyncio==1.6.0
|
|
14
14
|
Requires-Dist: paramiko==3.5.1
|
|
@@ -18,12 +18,12 @@ pyproject.toml
|
|
|
18
18
|
./bcmd/tasks/math.py
|
|
19
19
|
./bcmd/tasks/mirror.py
|
|
20
20
|
./bcmd/tasks/pdf.py
|
|
21
|
+
./bcmd/tasks/project.py
|
|
21
22
|
./bcmd/tasks/proxy.py
|
|
22
23
|
./bcmd/tasks/time.py
|
|
23
24
|
./bcmd/tasks/upgrade.py
|
|
24
25
|
./bcmd/tasks/wasabi.py
|
|
25
26
|
./bcmd/utils/__init__.py
|
|
26
|
-
./bcmd/utils/utils.py
|
|
27
27
|
./test/__init__.py
|
|
28
28
|
./test/conftest.py
|
|
29
29
|
./test/test_pdf.py
|
|
@@ -52,9 +52,9 @@ bcmd/tasks/lib.py
|
|
|
52
52
|
bcmd/tasks/math.py
|
|
53
53
|
bcmd/tasks/mirror.py
|
|
54
54
|
bcmd/tasks/pdf.py
|
|
55
|
+
bcmd/tasks/project.py
|
|
55
56
|
bcmd/tasks/proxy.py
|
|
56
57
|
bcmd/tasks/time.py
|
|
57
58
|
bcmd/tasks/upgrade.py
|
|
58
59
|
bcmd/tasks/wasabi.py
|
|
59
|
-
bcmd/utils/__init__.py
|
|
60
|
-
bcmd/utils/utils.py
|
|
60
|
+
bcmd/utils/__init__.py
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
[project]
|
|
5
5
|
name = 'bcmd'
|
|
6
|
-
version = '0.6.
|
|
6
|
+
version = '0.6.19'
|
|
7
7
|
description = 'Commands for Beni'
|
|
8
8
|
requires-python = '>=3.10'
|
|
9
9
|
keywords = ['benimang', 'beni', 'bcmd']
|
|
@@ -13,7 +13,7 @@ maintainers = [{ name = 'Beni Mang', email = 'benimang@126.com' }]
|
|
|
13
13
|
dependencies = [
|
|
14
14
|
"aioconsole==0.8.1",
|
|
15
15
|
"async-lru==2.0.5",
|
|
16
|
-
"benimang==0.8.
|
|
16
|
+
"benimang==0.8.9",
|
|
17
17
|
"cryptography==45.0.4",
|
|
18
18
|
"nest-asyncio==1.6.0",
|
|
19
19
|
"paramiko==3.5.1",
|
bcmd-0.6.17/bcmd/utils/utils.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|