bcmd 0.6.16__tar.gz → 0.6.18__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.16 → bcmd-0.6.18}/PKG-INFO +1 -1
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/__init__.py +1 -1
- bcmd-0.6.18/bcmd/tasks/project.py +34 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd.egg-info/PKG-INFO +1 -1
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd.egg-info/SOURCES.txt +2 -2
- {bcmd-0.6.16 → bcmd-0.6.18}/pyproject.toml +1 -1
- bcmd-0.6.16/bcmd/tasks/wslProxy.py +0 -59
- {bcmd-0.6.16 → bcmd-0.6.18}/MANIFEST.in +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/README.md +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/__init__.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/common/__init__.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/common/func.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/common/secret.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/resources/project/main.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/bin.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/code.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/crypto.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/docs.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/download.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/image.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/json.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/lib.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/math.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/mirror.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/pdf.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/proxy.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/time.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/upgrade.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/tasks/wasabi.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/utils/__init__.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd/utils/utils.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd.egg-info/dependency_links.txt +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd.egg-info/entry_points.txt +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd.egg-info/requires.txt +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/bcmd.egg-info/top_level.txt +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/setup.cfg +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/test/__init__.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/test/conftest.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/test/test_pdf.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/test/test_proxy.py +0 -0
- {bcmd-0.6.16 → bcmd-0.6.18}/test/test_wasabi.py +0 -0
|
@@ -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)
|
|
@@ -18,11 +18,11 @@ 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
|
-
./bcmd/tasks/wslProxy.py
|
|
26
26
|
./bcmd/utils/__init__.py
|
|
27
27
|
./bcmd/utils/utils.py
|
|
28
28
|
./test/__init__.py
|
|
@@ -53,10 +53,10 @@ bcmd/tasks/lib.py
|
|
|
53
53
|
bcmd/tasks/math.py
|
|
54
54
|
bcmd/tasks/mirror.py
|
|
55
55
|
bcmd/tasks/pdf.py
|
|
56
|
+
bcmd/tasks/project.py
|
|
56
57
|
bcmd/tasks/proxy.py
|
|
57
58
|
bcmd/tasks/time.py
|
|
58
59
|
bcmd/tasks/upgrade.py
|
|
59
60
|
bcmd/tasks/wasabi.py
|
|
60
|
-
bcmd/tasks/wslProxy.py
|
|
61
61
|
bcmd/utils/__init__.py
|
|
62
62
|
bcmd/utils/utils.py
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
from typing import Final
|
|
2
|
-
|
|
3
|
-
import pyperclip
|
|
4
|
-
import typer
|
|
5
|
-
from beni import bcolor, btask
|
|
6
|
-
from beni.bfunc import syncCall, textToAry
|
|
7
|
-
|
|
8
|
-
app: Final = btask.newSubApp('WSL2 代理服务')
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@app.command()
|
|
12
|
-
@syncCall
|
|
13
|
-
async def linux(
|
|
14
|
-
port: int = typer.Argument(15236, help="代理服务器端口"),
|
|
15
|
-
):
|
|
16
|
-
'生成终端设置代理服务器的命令'
|
|
17
|
-
ip = "$(ip route | grep default | awk '{print $3}')"
|
|
18
|
-
lineAry = textToAry(f'''
|
|
19
|
-
export HTTP_PROXY=http://{ip}:{port}
|
|
20
|
-
export HTTPS_PROXY=http://{ip}:{port}
|
|
21
|
-
export ALL_PROXY=http://{ip}:{port}
|
|
22
|
-
curl https://google.com.hk
|
|
23
|
-
''')
|
|
24
|
-
msg = '\r\n' + '\n'.join(lineAry) + '\n'
|
|
25
|
-
pyperclip.copy(msg.strip() + '\n')
|
|
26
|
-
bcolor.printMagenta(msg)
|
|
27
|
-
bcolor.printYellow('已复制,可直接粘贴使用')
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@app.command()
|
|
31
|
-
@syncCall
|
|
32
|
-
async def windows(
|
|
33
|
-
port: int = typer.Argument(15236, help="代理服务器端口"),
|
|
34
|
-
off: bool = typer.Option(False, '--off', help='关闭代理'),
|
|
35
|
-
):
|
|
36
|
-
'设置防火墙以及端口转发'
|
|
37
|
-
|
|
38
|
-
firewallName = 'Allow Veee from WSL'
|
|
39
|
-
|
|
40
|
-
if not off:
|
|
41
|
-
template = f'''
|
|
42
|
-
New-NetFirewallRule -DisplayName "{firewallName}" -Direction Inbound -Action Allow -Protocol TCP -LocalPort {port} -RemoteAddress 172.0.0.0/8 -Profile Any
|
|
43
|
-
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport={port} connectaddress=127.0.0.1 connectport={port}
|
|
44
|
-
netstat -ano | findstr :{port} | findstr 0.0.0.0
|
|
45
|
-
'''
|
|
46
|
-
else:
|
|
47
|
-
template = f'''
|
|
48
|
-
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport={port}
|
|
49
|
-
Remove-NetFirewallRule -DisplayName "{firewallName}"
|
|
50
|
-
'''
|
|
51
|
-
lineAry = textToAry(template)
|
|
52
|
-
msg = '\r\n' + '\n'.join(lineAry) + '\n'
|
|
53
|
-
pyperclip.copy(msg.strip() + '\n')
|
|
54
|
-
bcolor.printMagenta(msg)
|
|
55
|
-
if not off:
|
|
56
|
-
bcolor.printYellow('开启防火墙以及端口转发')
|
|
57
|
-
else:
|
|
58
|
-
bcolor.printYellow('关闭防火墙以及端口转发')
|
|
59
|
-
bcolor.printYellow('已复制,可直接粘贴使用')
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|