bcmd 0.5.12__py3-none-any.whl → 0.5.13__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/wasabi.py CHANGED
@@ -15,11 +15,11 @@ 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
24
  workspace = file.with_suffix('')
25
25
  assert not workspace.exists(), f'目录已存在 {workspace}'
@@ -35,17 +35,18 @@ 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
+ '将目录压缩成加密文件'
49
50
  workspace = workspace.absolute()
50
51
  assert workspace.is_dir(), f'不是目录 {workspace}'
51
52
  zipFile = workspace.with_suffix('.dat')
@@ -63,5 +64,22 @@ async def to_file(
63
64
  partA = bcrypto.encrypt(partA, password)
64
65
  data = partA + SEP + partB
65
66
  await bfile.writeBytes(zipFile, data)
67
+ await bpath.removeSecure(workspace)
66
68
  bcolor.printGreen(zipFile)
67
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.12
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>
@@ -25,9 +25,9 @@ bcmd/tasks/proxy.py,sha256=xvxN5PClUnc5LQpmq2Wug7_LUVpJboMWLXBvL9lX7EM,1552
25
25
  bcmd/tasks/time.py,sha256=ZiqA1jdgl-TBtFSOxxP51nwv4g9iZItmkFKpf9MKelk,2453
26
26
  bcmd/tasks/upgrade.py,sha256=ZiyecgVbnnoTU_LAsd78CIKA4ioc9so9pXpAM76b_0M,447
27
27
  bcmd/tasks/venv.py,sha256=a7ZDyagUPQvCAXx3cZJIqJt0p1Iy5u5qmmj8iRbDQZE,7673
28
- bcmd/tasks/wasabi.py,sha256=yZHlMxbhR_KOcRsaKjqF6OaKE17VetQ5urbkQXbI1w4,2331
29
- bcmd-0.5.12.dist-info/METADATA,sha256=7yqV9RoAaFlejfVkesMDKjikAIV59ceR_xiJ8rNE9Ms,500
30
- bcmd-0.5.12.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
31
- bcmd-0.5.12.dist-info/entry_points.txt,sha256=rHJrP6KEQpB-YaQqDFzEL2v88r03rxSfnzAayRvAqHU,39
32
- bcmd-0.5.12.dist-info/top_level.txt,sha256=-KrvhhtBcYsm4XhcjQvEcFbBB3VXeep7d3NIfDTrXKQ,5
33
- bcmd-0.5.12.dist-info/RECORD,,
28
+ bcmd/tasks/wasabi.py,sha256=W1sBLU1qp6VLSnRb2xUqPFWdcYpO79nY13hKnSYPwjY,2989
29
+ bcmd-0.5.13.dist-info/METADATA,sha256=t5pHvXBjqAP7F_ooOdXT3GKhTTgKZPqAqPywvIRr1Wc,500
30
+ bcmd-0.5.13.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
31
+ bcmd-0.5.13.dist-info/entry_points.txt,sha256=rHJrP6KEQpB-YaQqDFzEL2v88r03rxSfnzAayRvAqHU,39
32
+ bcmd-0.5.13.dist-info/top_level.txt,sha256=-KrvhhtBcYsm4XhcjQvEcFbBB3VXeep7d3NIfDTrXKQ,5
33
+ bcmd-0.5.13.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (76.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5