bcmd 0.6.16__py3-none-any.whl → 0.6.17__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/tasks/__init__.py CHANGED
@@ -14,4 +14,3 @@ from . import proxy
14
14
  from . import time
15
15
  from . import upgrade
16
16
  from . import wasabi
17
- from . import wslProxy
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bcmd
3
- Version: 0.6.16
3
+ Version: 0.6.17
4
4
  Summary: Commands for Beni
5
5
  Author-email: Beni Mang <benimang@126.com>
6
6
  Maintainer-email: Beni Mang <benimang@126.com>
@@ -3,7 +3,7 @@ bcmd/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  bcmd/common/func.py,sha256=MehbfuWFHTOsihhYxVFj0_U6-hjMTfLh3n-oMrpyyKo,508
4
4
  bcmd/common/secret.py,sha256=oHZCNnpAjrS3ztuTUy24IwSGeA_3Z8KfgnNP48ZVjrQ,2285
5
5
  bcmd/resources/project/main.py,sha256=xdskz_sf05fYA1SRMFCIxDjx8SnegxTbCmHpW86ItLs,11
6
- bcmd/tasks/__init__.py,sha256=TWpSQfFnPNIcjzPIMHSjtMFvrbuQdq5pIgRv-zC8l6A,335
6
+ bcmd/tasks/__init__.py,sha256=aP4bOLeBoVWbG7zihc5lRh980ILLqH5PUkGe8MULGCE,312
7
7
  bcmd/tasks/bin.py,sha256=DufZGRX7b2zclSaZM-zUPGwOiycN9RsV8KxF8tfSyqs,3240
8
8
  bcmd/tasks/code.py,sha256=IUs_ClZuSsBk2gavlitC8mkRrQQX9rvNDgR8cFxduBA,3992
9
9
  bcmd/tasks/crypto.py,sha256=LKvgsMPLvsi1wlt66TinYiN-oV2IPAfaN9y7hWaVpHs,2951
@@ -19,7 +19,6 @@ bcmd/tasks/proxy.py,sha256=B85ebW_XPo_21j0YKf3oOK-8Crr85ezaPeZZnbnvO4E,1896
19
19
  bcmd/tasks/time.py,sha256=ZiqA1jdgl-TBtFSOxxP51nwv4g9iZItmkFKpf9MKelk,2453
20
20
  bcmd/tasks/upgrade.py,sha256=nyhcl5oGAUnOOR8JJZW2jfepcVJ6O9gufK8VgxUeil0,543
21
21
  bcmd/tasks/wasabi.py,sha256=xWFAxprSIlBqDDMGaNXZFb-SahnW1d_R9XxSKRYIhnM,3110
22
- bcmd/tasks/wslProxy.py,sha256=1i1oyeNzUlmJS0QHv5XQABANiy9i_o-IpE3lymHUBJc,2009
23
22
  bcmd/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
23
  bcmd/utils/utils.py,sha256=Oyf5ubxaCD_T2GOz3zJkR4AJzfVcfBqtmL8Gk8_gOJs,202
25
24
  test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -27,8 +26,8 @@ test/conftest.py,sha256=grlPunlsvrkt_8QPckmF4POiKUPVxIxm2TPAh_ZB-zs,405
27
26
  test/test_pdf.py,sha256=7yYlfydyhy2dmVYdTA5Vir2AI8TUdzEi55fL-AqJmio,1533
28
27
  test/test_proxy.py,sha256=UMF2hFFGUEbJR1jT2mO_wdo-7Rfp0NDqIdTRnOmwtjY,164
29
28
  test/test_wasabi.py,sha256=qqXG1Kb9hKH6t624R173j6LagkgmejN0CFYt7kL0nNs,1066
30
- bcmd-0.6.16.dist-info/METADATA,sha256=Kea4dPNNm8Bn-BzR3-4Jt3lAE54x6-j5-62y3N2Ffbo,845
31
- bcmd-0.6.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
- bcmd-0.6.16.dist-info/entry_points.txt,sha256=mriCeYh3wksKcqq3-LtzyFkSCIdN1uZc1IJwom-SW1s,34
33
- bcmd-0.6.16.dist-info/top_level.txt,sha256=fYY6tRrJ_G7tn24RXAG0M5ZKbcuaQznodfX1toFPSKs,10
34
- bcmd-0.6.16.dist-info/RECORD,,
29
+ bcmd-0.6.17.dist-info/METADATA,sha256=gzmWaAkKMUA-RBVPTkUWfWuWkRWJA-ApuxT_aBDRL4Y,845
30
+ bcmd-0.6.17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
+ bcmd-0.6.17.dist-info/entry_points.txt,sha256=mriCeYh3wksKcqq3-LtzyFkSCIdN1uZc1IJwom-SW1s,34
32
+ bcmd-0.6.17.dist-info/top_level.txt,sha256=fYY6tRrJ_G7tn24RXAG0M5ZKbcuaQznodfX1toFPSKs,10
33
+ bcmd-0.6.17.dist-info/RECORD,,
bcmd/tasks/wslProxy.py DELETED
@@ -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