bcmd 0.5.11__tar.gz → 0.5.13__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 (39) hide show
  1. {bcmd-0.5.11 → bcmd-0.5.13}/PKG-INFO +1 -1
  2. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/wasabi.py +27 -8
  3. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd.egg-info/PKG-INFO +1 -1
  4. {bcmd-0.5.11 → bcmd-0.5.13}/pyproject.toml +1 -1
  5. {bcmd-0.5.11 → bcmd-0.5.13}/MANIFEST.in +0 -0
  6. {bcmd-0.5.11 → bcmd-0.5.13}/README.md +0 -0
  7. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/__init__.py +0 -0
  8. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/common/__init__.py +0 -0
  9. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/common/func.py +0 -0
  10. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/common/password.py +0 -0
  11. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/main.py +0 -0
  12. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/resources/project/.gitignore +0 -0
  13. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/resources/project/.vscode/launch.json +0 -0
  14. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/resources/project/.vscode/settings.json +0 -0
  15. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/resources/project/.vscode/tasks.json +0 -0
  16. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/resources/project/main.py +0 -0
  17. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/__init__.py +0 -0
  18. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/bin.py +0 -0
  19. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/code.py +0 -0
  20. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/crypto.py +0 -0
  21. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/debian.py +0 -0
  22. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/download.py +0 -0
  23. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/image.py +0 -0
  24. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/json.py +0 -0
  25. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/lib.py +0 -0
  26. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/math.py +0 -0
  27. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/mirror.py +0 -0
  28. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/pdf.py +0 -0
  29. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/project.py +0 -0
  30. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/proxy.py +0 -0
  31. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/time.py +0 -0
  32. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/upgrade.py +0 -0
  33. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd/tasks/venv.py +0 -0
  34. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd.egg-info/SOURCES.txt +0 -0
  35. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd.egg-info/dependency_links.txt +0 -0
  36. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd.egg-info/entry_points.txt +0 -0
  37. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd.egg-info/requires.txt +0 -0
  38. {bcmd-0.5.11 → bcmd-0.5.13}/bcmd.egg-info/top_level.txt +0 -0
  39. {bcmd-0.5.11 → bcmd-0.5.13}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: bcmd
3
- Version: 0.5.11
3
+ Version: 0.5.13
4
4
  Summary: Commands for Beni
5
5
  Author-email: Beni Mang <benimang@126.com>
6
6
  Maintainer-email: Beni Mang <benimang@126.com>
@@ -15,13 +15,13 @@ MAX_ENCRYPT_SIZE = 199 * 1024
15
15
 
16
16
  @app.command()
17
17
  @syncCall
18
- async def to_dir(
19
- file: Path = typer.Argument(Path.cwd(), help='工作文件'),
18
+ async def unzip(
19
+ file: Path = typer.Argument(Path.cwd(), help='加密文件'),
20
20
  password: str = typer.Option('', '--password', '-p', help='密码'),
21
21
  ):
22
- '生成目录'
22
+ '解压缩加密文件成目录'
23
23
  assert file.is_file(), f'不是文件 {file}'
24
- workspace = file.parent / file.stem
24
+ workspace = file.with_suffix('')
25
25
  assert not workspace.exists(), f'目录已存在 {workspace}'
26
26
  password = password or getpass.getpass('请输入密码: ')
27
27
  with bpath.useTempFile() as tempFile:
@@ -35,19 +35,21 @@ async def to_dir(
35
35
  data = shuffleSequence(data)
36
36
  await bfile.writeBytes(tempFile, data)
37
37
  await bzip.sevenUnzip(tempFile, workspace)
38
+ await bpath.removeSecure(file)
38
39
  bcolor.printGreen(workspace)
39
40
  bcolor.printGreen('OK')
40
41
 
41
42
 
42
43
  @app.command()
43
44
  @syncCall
44
- async def to_file(
45
- workspace: Path = typer.Argument(Path.cwd(), help='工作目录'),
45
+ async def zip(
46
+ workspace: Path = typer.Argument(Path.cwd(), help='输出目录'),
46
47
  password: str = typer.Option('', '--password', '-p', help='密码'),
47
48
  ):
48
- '生成文件'
49
+ '将目录压缩成加密文件'
50
+ workspace = workspace.absolute()
49
51
  assert workspace.is_dir(), f'不是目录 {workspace}'
50
- zipFile = workspace.parent / f'{workspace.name}.dat'
52
+ zipFile = workspace.with_suffix('.dat')
51
53
  assert not zipFile.exists(), f'文件已存在 {zipFile}'
52
54
  password = password or genPassword()
53
55
  with bpath.useTempFile() as tempFile:
@@ -62,5 +64,22 @@ async def to_file(
62
64
  partA = bcrypto.encrypt(partA, password)
63
65
  data = partA + SEP + partB
64
66
  await bfile.writeBytes(zipFile, data)
67
+ await bpath.removeSecure(workspace)
65
68
  bcolor.printGreen(zipFile)
66
69
  bcolor.printGreen('OK')
70
+
71
+
72
+ @app.command()
73
+ @syncCall
74
+ async def change_pass(
75
+ file: Path = typer.Argument(Path.cwd(), help='加密文件'),
76
+ password: str = typer.Option('', '--password', '-p', help='密码'),
77
+ new_password: str = typer.Option('', '--new-password', '-n', help='新密码'),
78
+ ):
79
+ with bpath.useTempPath() as tempPath:
80
+ tempFile = tempPath / file.name
81
+ bpath.copy(file, tempFile)
82
+ unzip(tempFile, password)
83
+ workspace = tempFile.with_suffix('')
84
+ zip(workspace, new_password)
85
+ bpath.copy(tempFile, file)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: bcmd
3
- Version: 0.5.11
3
+ Version: 0.5.13
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.5.11'
6
+ version = '0.5.13'
7
7
  description = 'Commands for Beni'
8
8
  requires-python = '>=3.10'
9
9
  keywords = ['benimang', 'beni', 'bcmd']
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