bcmd 0.0.53__tar.gz → 0.0.56__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.

Files changed (27) hide show
  1. {bcmd-0.0.53 → bcmd-0.0.56}/PKG-INFO +1 -1
  2. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/common/password.py +1 -1
  3. bcmd-0.0.56/bcmd/tasks/pwd.py +101 -0
  4. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/tasks/venv.py +16 -0
  5. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd.egg-info/PKG-INFO +1 -1
  6. {bcmd-0.0.53 → bcmd-0.0.56}/pyproject.toml +1 -1
  7. bcmd-0.0.53/bcmd/tasks/pwd.py +0 -55
  8. {bcmd-0.0.53 → bcmd-0.0.56}/MANIFEST.in +0 -0
  9. {bcmd-0.0.53 → bcmd-0.0.56}/README.md +0 -0
  10. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/__init__.py +0 -0
  11. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/common/__init__.py +0 -0
  12. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/main.py +0 -0
  13. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/tasks/__init__.py +0 -0
  14. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/tasks/bin.py +0 -0
  15. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/tasks/json.py +0 -0
  16. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/tasks/lib.py +0 -0
  17. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/tasks/math.py +0 -0
  18. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/tasks/mirror.py +0 -0
  19. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/tasks/proxy.py +0 -0
  20. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/tasks/task.py +0 -0
  21. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd/tasks/time.py +0 -0
  22. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd.egg-info/SOURCES.txt +0 -0
  23. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd.egg-info/dependency_links.txt +0 -0
  24. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd.egg-info/entry_points.txt +0 -0
  25. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd.egg-info/requires.txt +0 -0
  26. {bcmd-0.0.53 → bcmd-0.0.56}/bcmd.egg-info/top_level.txt +0 -0
  27. {bcmd-0.0.53 → bcmd-0.0.56}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bcmd
3
- Version: 0.0.53
3
+ Version: 0.0.56
4
4
  Summary: Commands for Beni
5
5
  Author-email: Beni Mang <benimang@126.com>
6
6
  Maintainer-email: Beni Mang <benimang@126.com>
@@ -11,7 +11,7 @@ async def getPypi() -> tuple[str, str]:
11
11
  with tryRun():
12
12
  data = _getData(
13
13
  '输入密码(pypi)',
14
- 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImJlbmltYW5nIiwicGFzc3dvIjoxNjk2OTIxNDg3Ljg2NzY5MTN9.WvtsFXFB0fk7GTj01tfed1BF-gmDv-3U4bVmcN2wT9wcmQiOiJweXBpMDA5OTg4IiwiODVlYmMwMmQtZDg4MS00NWJiLWE3ZjktNTdkZDA1YjJiNjg2'
14
+ 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Il9fdG9rZW5fXyIsInBhc3N3b3JkIjoicHlwaS1BZ0VJY0hsd2FTNXZjbWNDSkRrM05qWTFOMk5tTFRsaU9URXROR0ZsT1MwNVlUQTBMVFE0WVQ2NlTzlIbkx4RG9Ca3ciLCIzMGE0YTM1Ni0zNmYwLTQ4NTktODk3Zi0xZDFmZDRkMmVhMWQiOjE3MDA4NDU1ODQuNDg5MTY2fQ.YjsYWtUxfsDbHJRQiFSzfuNKDnccC3gxGbAk_bW-LBARCak5EUmlOR1ppWVFBQ0tsc3pMQ0ppT0RBMU16QmhaUzFrTURZekxUUTBZbVF0T0dJMU1pMHdNMlZqWVRSaFlUYzJZV1lpWFFBQUJpQWNvaWxLNlA2TVNZSklETnlvXzcwTXkybzVPWWR3'
15
15
  )
16
16
  return data['username'], data['password']
17
17
 
@@ -0,0 +1,101 @@
1
+ import getpass
2
+ import json
3
+ import uuid
4
+ from typing import Final
5
+
6
+ import jwt
7
+ import pyperclip
8
+ from beni import bcolor, btask
9
+ from beni.bfunc import magicSequence, syncCall
10
+ from rich.console import Console
11
+
12
+ app: Final = btask.newSubApp('lib 工具')
13
+
14
+
15
+ _KEY_SALT = '_salt_@#%@#xafDGAz.nq'
16
+ _KEY_TEXT = '_text_A!@$,FJ@#adsfkl'
17
+
18
+
19
+ @app.command()
20
+ @syncCall
21
+ async def encode_json():
22
+ '生成JSON密文(使用剪贴板内容)'
23
+ content = pyperclip.paste()
24
+ try:
25
+ data = json.loads(content)
26
+ except:
27
+ return btask.abort('错误:剪贴板内容必须是JSON格式', content)
28
+ Console().print_json(data=data, indent=4, ensure_ascii=False, sort_keys=True)
29
+ password = ''
30
+ while not password:
31
+ password = getpass.getpass('输入密码:')
32
+ while password != getpass.getpass('再次密码:'):
33
+ pass
34
+ data[_KEY_SALT] = str(uuid.uuid4())
35
+ result = jwt.encode(data, password, algorithm='HS256')
36
+ result = magicSequence(result)
37
+ pyperclip.copy(result)
38
+ print('密文已复制到剪贴板')
39
+ bcolor.printYellow(result)
40
+ bcolor.printGreen('OK')
41
+ # {"uuu": "xxx", "ppp": "xxx"}
42
+
43
+
44
+ @app.command()
45
+ @syncCall
46
+ async def decode_json():
47
+ '还原JSON密文内容(使用剪贴板内容)'
48
+ content = pyperclip.paste()
49
+ bcolor.printYellow(content)
50
+ content = magicSequence(content)
51
+ password = ''
52
+ while not password:
53
+ password = getpass.getpass('输入密码:')
54
+ try:
55
+ data = jwt.decode(content, password, algorithms=['HS256'])
56
+ if _KEY_SALT in data:
57
+ del data[_KEY_SALT]
58
+ Console().print_json(data=data, indent=4, ensure_ascii=False, sort_keys=True)
59
+ except:
60
+ return btask.abort('无法解析密文')
61
+
62
+
63
+ @app.command()
64
+ @syncCall
65
+ async def encode_text():
66
+ '生成文本密文(使用剪贴板内容)'
67
+ content = pyperclip.paste()
68
+ bcolor.printYellow(content)
69
+ data = {
70
+ _KEY_TEXT: content,
71
+ _KEY_SALT: str(uuid.uuid4()),
72
+ }
73
+ password = ''
74
+ while not password:
75
+ password = getpass.getpass('输入密码:')
76
+ while password != getpass.getpass('再次密码:'):
77
+ pass
78
+ result = jwt.encode(data, password, algorithm='HS256')
79
+ result = magicSequence(result)
80
+ pyperclip.copy(result)
81
+ print('密文已复制到剪贴板')
82
+ bcolor.printYellow(result)
83
+ bcolor.printGreen('OK')
84
+
85
+
86
+ @app.command()
87
+ @syncCall
88
+ async def decode_text():
89
+ '还原文本密文内容(使用剪贴板内容)'
90
+ content = pyperclip.paste()
91
+ bcolor.printYellow(content)
92
+ content = magicSequence(content)
93
+ password = ''
94
+ while not password:
95
+ password = getpass.getpass('输入密码:')
96
+ try:
97
+ data = jwt.decode(content, password, algorithms=['HS256'])
98
+ content = data[_KEY_TEXT]
99
+ bcolor.printYellow(content)
100
+ except:
101
+ return btask.abort('无法解析密文')
@@ -5,6 +5,11 @@ from typing import Final
5
5
  import typer
6
6
  from beni import bexecute, bfile, bhttp, binput, bpath, btask
7
7
  from beni.bfunc import syncCall
8
+ from beni.btype import Null
9
+
10
+ from bcmd.common import password
11
+
12
+ from . import bin
8
13
 
9
14
  app: Final = btask.app
10
15
 
@@ -18,6 +23,7 @@ async def venv(
18
23
  quiet: bool = typer.Option(False, '--quiet', '-q', help='是否安静模式'),
19
24
  ):
20
25
  'python 虚拟环境配置'
26
+ await password.getQiniu()
21
27
  packages = packages or []
22
28
  for i in range(len(packages)):
23
29
  package = packages[i]
@@ -51,6 +57,16 @@ async def venv(
51
57
  pip = bpath.get(venvPath, 'Scripts/pip.exe')
52
58
  await pipInstall(pip, targetFile)
53
59
  await bexecute.run(f'{pip} freeze > {venvLockFile}')
60
+
61
+ # 下载 bin 文件
62
+ binListFile = bpath.get(path, 'bin.list')
63
+ if binListFile.exists():
64
+ bin.download(
65
+ names=Null,
66
+ file=binListFile,
67
+ output=path / 'bin',
68
+ )
69
+
54
70
  finally:
55
71
  if tempFile.is_file():
56
72
  bpath.move(tempFile, pipIniFile, True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bcmd
3
- Version: 0.0.53
3
+ Version: 0.0.56
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 @@
3
3
 
4
4
  [project]
5
5
  name = 'bcmd'
6
- version = '0.0.53'
6
+ version = '0.0.56'
7
7
  description = 'Commands for Beni'
8
8
  requires-python = '>=3.10'
9
9
  keywords = ['benimang', 'beni', 'bcmd']
@@ -1,55 +0,0 @@
1
- import getpass
2
- import json
3
- import time
4
- import uuid
5
- from typing import Final
6
-
7
- import jwt
8
- import pyperclip
9
- from beni import bcolor, btask
10
- from beni.bfunc import magicSequence, syncCall
11
- from rich.console import Console
12
-
13
- app: Final = btask.newSubApp('lib 工具')
14
-
15
-
16
- @app.command()
17
- @syncCall
18
- async def encode():
19
- '生成密文(JSON内容需要先复制到剪贴板)'
20
- content = pyperclip.paste()
21
- try:
22
- data = json.loads(content)
23
- except:
24
- return btask.abort('错误:剪贴板内容必须是JSON格式', content)
25
- Console().print_json(data=data, indent=4, ensure_ascii=False, sort_keys=True)
26
- password = ''
27
- while not password:
28
- password = getpass.getpass('输入密码:')
29
- while password != getpass.getpass('再次密码:'):
30
- pass
31
- data[str(uuid.uuid4())] = time.time()
32
- result = jwt.encode(data, password, algorithm='HS256')
33
- result = magicSequence(result)
34
- pyperclip.copy(result)
35
- print('密文已复制到剪贴板')
36
- bcolor.printYellow(result)
37
- bcolor.printGreen('OK')
38
- # {"uuu": "xxx", "ppp": "xxx"}
39
-
40
-
41
- @app.command()
42
- @syncCall
43
- async def decode():
44
- '还原密文内容'
45
- content = pyperclip.paste()
46
- bcolor.printYellow(content)
47
- content = magicSequence(content)
48
- password = ''
49
- while not password:
50
- password = getpass.getpass('输入密码:')
51
- try:
52
- data = jwt.decode(content, password, algorithms=['HS256'])
53
- Console().print_json(data=data, indent=4, ensure_ascii=False, sort_keys=True)
54
- except:
55
- return btask.abort('无法解析密文')
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