bcmd 0.0.52__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 (30) hide show
  1. bcmd-0.0.56/PKG-INFO +11 -0
  2. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/common/password.py +1 -1
  3. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/tasks/lib.py +2 -2
  4. bcmd-0.0.56/bcmd/tasks/pwd.py +101 -0
  5. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/tasks/venv.py +16 -0
  6. bcmd-0.0.56/bcmd.egg-info/PKG-INFO +11 -0
  7. bcmd-0.0.56/bcmd.egg-info/requires.txt +3 -0
  8. {bcmd-0.0.52 → bcmd-0.0.56}/pyproject.toml +2 -20
  9. bcmd-0.0.52/PKG-INFO +0 -29
  10. bcmd-0.0.52/bcmd/tasks/pwd.py +0 -55
  11. bcmd-0.0.52/bcmd.egg-info/PKG-INFO +0 -29
  12. bcmd-0.0.52/bcmd.egg-info/requires.txt +0 -21
  13. {bcmd-0.0.52 → bcmd-0.0.56}/MANIFEST.in +0 -0
  14. {bcmd-0.0.52 → bcmd-0.0.56}/README.md +0 -0
  15. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/__init__.py +0 -0
  16. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/common/__init__.py +0 -0
  17. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/main.py +0 -0
  18. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/tasks/__init__.py +0 -0
  19. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/tasks/bin.py +0 -0
  20. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/tasks/json.py +0 -0
  21. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/tasks/math.py +0 -0
  22. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/tasks/mirror.py +0 -0
  23. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/tasks/proxy.py +0 -0
  24. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/tasks/task.py +0 -0
  25. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd/tasks/time.py +0 -0
  26. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd.egg-info/SOURCES.txt +0 -0
  27. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd.egg-info/dependency_links.txt +0 -0
  28. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd.egg-info/entry_points.txt +0 -0
  29. {bcmd-0.0.52 → bcmd-0.0.56}/bcmd.egg-info/top_level.txt +0 -0
  30. {bcmd-0.0.52 → bcmd-0.0.56}/setup.cfg +0 -0
bcmd-0.0.56/PKG-INFO ADDED
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.1
2
+ Name: bcmd
3
+ Version: 0.0.56
4
+ Summary: Commands for Beni
5
+ Author-email: Beni Mang <benimang@126.com>
6
+ Maintainer-email: Beni Mang <benimang@126.com>
7
+ Keywords: benimang,beni,bcmd
8
+ Requires-Python: >=3.10
9
+ Requires-Dist: benimang==0.4.34
10
+ Requires-Dist: pathspec
11
+ Requires-Dist: pyjwt
@@ -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
 
@@ -47,7 +47,7 @@ async def version(
47
47
  disabled_commit: bool = typer.Option(False, '--disabled-commit', '-d', help='是否提交git'),
48
48
  with_dependencies_version: bool = typer.Option(False, '--with_dependencies_version', help='第三方库是否带版本号')
49
49
  ):
50
- '修改 pyproject.toml 版本号'
50
+ '修改 pyproject.toml 版本号(同时会更新依赖列表)'
51
51
  if not workspace_path:
52
52
  workspace_path = Path.cwd()
53
53
  file = workspace_path / 'pyproject.toml'
@@ -66,7 +66,7 @@ async def version(
66
66
  else:
67
67
  raise Exception('版本号修改失败,先检查文件中定义的版本号格式是否正常')
68
68
  await bfile.writeText(file, content)
69
- bcolor.printCyan(f'{version} => {newVersion}')
69
+ bcolor.printCyan(newVersion)
70
70
  if not disabled_commit:
71
71
  msg = ''.join([
72
72
  f'更新版本号 {newVersion}',
@@ -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)
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.1
2
+ Name: bcmd
3
+ Version: 0.0.56
4
+ Summary: Commands for Beni
5
+ Author-email: Beni Mang <benimang@126.com>
6
+ Maintainer-email: Beni Mang <benimang@126.com>
7
+ Keywords: benimang,beni,bcmd
8
+ Requires-Python: >=3.10
9
+ Requires-Dist: benimang==0.4.34
10
+ Requires-Dist: pathspec
11
+ Requires-Dist: pyjwt
@@ -0,0 +1,3 @@
1
+ benimang==0.4.34
2
+ pathspec
3
+ pyjwt
@@ -3,7 +3,7 @@
3
3
 
4
4
  [project]
5
5
  name = 'bcmd'
6
- version = '0.0.52'
6
+ version = '0.0.56'
7
7
  description = 'Commands for Beni'
8
8
  requires-python = '>=3.10'
9
9
  keywords = ['benimang', 'beni', 'bcmd']
@@ -12,27 +12,9 @@ maintainers = [{ name = 'Beni Mang', email = 'benimang@126.com' }]
12
12
 
13
13
 
14
14
  dependencies = [
15
- 'aioconsole',
16
- 'aiofiles',
17
- 'aiohttp',
18
- 'autopep8',
19
- 'benimang==0.4.33',
20
- 'build',
21
- 'colorama',
22
- 'nest-asyncio',
23
- 'orjson',
15
+ 'benimang==0.4.34',
24
16
  'pathspec',
25
- 'portalocker',
26
- 'pretty_errors',
27
- 'prettytable',
28
17
  'pyjwt',
29
- 'pyperclip',
30
- 'pyyaml',
31
- 'qiniu',
32
- 'rich',
33
- 'twine',
34
- 'typer',
35
- 'tzdata',
36
18
  ]
37
19
 
38
20
  [project.scripts]
bcmd-0.0.52/PKG-INFO DELETED
@@ -1,29 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: bcmd
3
- Version: 0.0.52
4
- Summary: Commands for Beni
5
- Author-email: Beni Mang <benimang@126.com>
6
- Maintainer-email: Beni Mang <benimang@126.com>
7
- Keywords: benimang,beni,bcmd
8
- Requires-Python: >=3.10
9
- Requires-Dist: aioconsole
10
- Requires-Dist: aiofiles
11
- Requires-Dist: aiohttp
12
- Requires-Dist: autopep8
13
- Requires-Dist: benimang==0.4.33
14
- Requires-Dist: build
15
- Requires-Dist: colorama
16
- Requires-Dist: nest-asyncio
17
- Requires-Dist: orjson
18
- Requires-Dist: pathspec
19
- Requires-Dist: portalocker
20
- Requires-Dist: pretty_errors
21
- Requires-Dist: prettytable
22
- Requires-Dist: pyjwt
23
- Requires-Dist: pyperclip
24
- Requires-Dist: pyyaml
25
- Requires-Dist: qiniu
26
- Requires-Dist: rich
27
- Requires-Dist: twine
28
- Requires-Dist: typer
29
- Requires-Dist: tzdata
@@ -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('无法解析密文')
@@ -1,29 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: bcmd
3
- Version: 0.0.52
4
- Summary: Commands for Beni
5
- Author-email: Beni Mang <benimang@126.com>
6
- Maintainer-email: Beni Mang <benimang@126.com>
7
- Keywords: benimang,beni,bcmd
8
- Requires-Python: >=3.10
9
- Requires-Dist: aioconsole
10
- Requires-Dist: aiofiles
11
- Requires-Dist: aiohttp
12
- Requires-Dist: autopep8
13
- Requires-Dist: benimang==0.4.33
14
- Requires-Dist: build
15
- Requires-Dist: colorama
16
- Requires-Dist: nest-asyncio
17
- Requires-Dist: orjson
18
- Requires-Dist: pathspec
19
- Requires-Dist: portalocker
20
- Requires-Dist: pretty_errors
21
- Requires-Dist: prettytable
22
- Requires-Dist: pyjwt
23
- Requires-Dist: pyperclip
24
- Requires-Dist: pyyaml
25
- Requires-Dist: qiniu
26
- Requires-Dist: rich
27
- Requires-Dist: twine
28
- Requires-Dist: typer
29
- Requires-Dist: tzdata
@@ -1,21 +0,0 @@
1
- aioconsole
2
- aiofiles
3
- aiohttp
4
- autopep8
5
- benimang==0.4.33
6
- build
7
- colorama
8
- nest-asyncio
9
- orjson
10
- pathspec
11
- portalocker
12
- pretty_errors
13
- prettytable
14
- pyjwt
15
- pyperclip
16
- pyyaml
17
- qiniu
18
- rich
19
- twine
20
- typer
21
- tzdata
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