bcmd 0.5.6__py3-none-any.whl → 0.5.8__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/main.py +1 -1
- bcmd/tasks/code.py +7 -2
- bcmd/tasks/image.py +9 -2
- {bcmd-0.5.6.dist-info → bcmd-0.5.8.dist-info}/METADATA +1 -1
- {bcmd-0.5.6.dist-info → bcmd-0.5.8.dist-info}/RECORD +8 -8
- {bcmd-0.5.6.dist-info → bcmd-0.5.8.dist-info}/WHEEL +0 -0
- {bcmd-0.5.6.dist-info → bcmd-0.5.8.dist-info}/entry_points.txt +0 -0
- {bcmd-0.5.6.dist-info → bcmd-0.5.8.dist-info}/top_level.txt +0 -0
bcmd/main.py
CHANGED
bcmd/tasks/code.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
import os
|
|
2
3
|
from pathlib import Path
|
|
3
4
|
from typing import Final
|
|
4
5
|
|
|
@@ -112,14 +113,18 @@ async def to_lf(
|
|
|
112
113
|
'.pytest_cache',
|
|
113
114
|
'__pycache__',
|
|
114
115
|
]
|
|
116
|
+
path = path or Path(os.getcwd())
|
|
115
117
|
files = bpath.listFile(path, True)
|
|
116
118
|
# 剔除子目录是这些的文件 .git venv ...
|
|
117
119
|
files = [x for x in files if not any([y in x.parts for y in ignoreSubDirs])]
|
|
118
120
|
|
|
119
121
|
async def convertFile(file: Path):
|
|
120
122
|
try:
|
|
121
|
-
await bfile.
|
|
122
|
-
|
|
123
|
+
content = await bfile.readText(file)
|
|
124
|
+
if '\r\n' in content:
|
|
125
|
+
content = content.replace('\r\n', '\n')
|
|
126
|
+
await bfile.writeText(file, content)
|
|
127
|
+
printYellow(file)
|
|
123
128
|
except:
|
|
124
129
|
pass
|
|
125
130
|
|
bcmd/tasks/image.py
CHANGED
|
@@ -65,7 +65,7 @@ async def convert(
|
|
|
65
65
|
@syncCall
|
|
66
66
|
async def tiny(
|
|
67
67
|
path: Path = typer.Option(None, '--path', help='指定目录或具体图片文件,默认当前目录'),
|
|
68
|
-
|
|
68
|
+
optimization: int = typer.Option(25, '--optimization', help='指定优化大小,如果没有达到优化效果就不处理,单位:%,默认25'),
|
|
69
69
|
isKeepOriginal: bool = typer.Option(False, '--keep-original', help='保留原始图片'),
|
|
70
70
|
):
|
|
71
71
|
|
|
@@ -75,6 +75,9 @@ async def tiny(
|
|
|
75
75
|
'q8YLcvrXVW2NYcr5mMyzQhsSHF4j7gny',
|
|
76
76
|
]
|
|
77
77
|
random.shuffle(keyList)
|
|
78
|
+
|
|
79
|
+
btask.assertTrue(0 < optimization < 100, '优化大小必须在0-100之间')
|
|
80
|
+
compression = 100 - optimization
|
|
78
81
|
await block.setLimit(_TinyFile.runTiny, len(keyList))
|
|
79
82
|
|
|
80
83
|
# 整理文件列表
|
|
@@ -103,7 +106,11 @@ async def tiny(
|
|
|
103
106
|
pass
|
|
104
107
|
else:
|
|
105
108
|
# 要忽略掉的文件
|
|
106
|
-
|
|
109
|
+
if file.isTiny:
|
|
110
|
+
bcolor.printYellow(f'{file.file}({file.compression - 100:.2f}% / 已压缩 / {file.getSizeDisplay()})')
|
|
111
|
+
else:
|
|
112
|
+
bcolor.printMagenta(f'{file.file}({file.compression - 100:.2f}% / 不处理 / {file.getSizeDisplay()})')
|
|
113
|
+
|
|
107
114
|
fileList[i] = Null
|
|
108
115
|
fileList = [x for x in fileList if x]
|
|
109
116
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
bcmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
bcmd/main.py,sha256=
|
|
2
|
+
bcmd/main.py,sha256=GP_60-6vImXqdMfC5vc4xlscWajx4OYmnlNXASWn19w,147
|
|
3
3
|
bcmd/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
bcmd/common/func.py,sha256=MehbfuWFHTOsihhYxVFj0_U6-hjMTfLh3n-oMrpyyKo,508
|
|
5
5
|
bcmd/common/password.py,sha256=25fA1h9ttZuUobnZ_nA0Ouhmk43etBfGeM40dgxJnFY,1347
|
|
@@ -10,11 +10,11 @@ bcmd/resources/project/.vscode/settings.json,sha256=G4rCroWxEHcQfsqIJ6CXRHI6VGr3
|
|
|
10
10
|
bcmd/resources/project/.vscode/tasks.json,sha256=gouhpkrqiPz7v65Jw1Rz-BCYU3sSdmphzXIYCzVnoe0,1783
|
|
11
11
|
bcmd/tasks/__init__.py,sha256=siqJwKgsjiIQzarBsQaucjm6VEvDr1pJDuEd7UnDXSQ,316
|
|
12
12
|
bcmd/tasks/bin.py,sha256=B_e-HYOc2Cohk-1PbKHyKn3RhI8TAUfI2EBRoFEHiTM,2961
|
|
13
|
-
bcmd/tasks/code.py,sha256=
|
|
13
|
+
bcmd/tasks/code.py,sha256=IUs_ClZuSsBk2gavlitC8mkRrQQX9rvNDgR8cFxduBA,3992
|
|
14
14
|
bcmd/tasks/crypto.py,sha256=C2welnYfdI4Tc-W1cwkboGb6bk6NGWO0MRKm4Bzo_9Q,3216
|
|
15
15
|
bcmd/tasks/debian.py,sha256=B9aMIIct3vNqMJr5hTr1GegXVf20H49C27FMvRRGIzI,3004
|
|
16
16
|
bcmd/tasks/download.py,sha256=XdZYKi8zQTNYWEgUxeTNDqPgP7IGYJkMmlDDC9u93Vk,2315
|
|
17
|
-
bcmd/tasks/image.py,sha256=
|
|
17
|
+
bcmd/tasks/image.py,sha256=fxCiP9Xs4mxj6PhnZY2nRc0pvYg0DAbEIOFHhj-BkXA,8088
|
|
18
18
|
bcmd/tasks/json.py,sha256=WWOyvcZPYaqQgp-Tkm-uIJschNMBKPKtZN3yXz_SC5s,635
|
|
19
19
|
bcmd/tasks/lib.py,sha256=lq-PdHxhK-5Akf7k4QaIT8mBB-sCK5or5OqEFTdphIA,4567
|
|
20
20
|
bcmd/tasks/math.py,sha256=xbl5UdaDMyAjiLodDPleP4Cutrk2S3NOAgurzAgOEAE,2862
|
|
@@ -24,8 +24,8 @@ bcmd/tasks/proxy.py,sha256=xvxN5PClUnc5LQpmq2Wug7_LUVpJboMWLXBvL9lX7EM,1552
|
|
|
24
24
|
bcmd/tasks/time.py,sha256=ZiqA1jdgl-TBtFSOxxP51nwv4g9iZItmkFKpf9MKelk,2453
|
|
25
25
|
bcmd/tasks/upgrade.py,sha256=ZiyecgVbnnoTU_LAsd78CIKA4ioc9so9pXpAM76b_0M,447
|
|
26
26
|
bcmd/tasks/venv.py,sha256=a7ZDyagUPQvCAXx3cZJIqJt0p1Iy5u5qmmj8iRbDQZE,7673
|
|
27
|
-
bcmd-0.5.
|
|
28
|
-
bcmd-0.5.
|
|
29
|
-
bcmd-0.5.
|
|
30
|
-
bcmd-0.5.
|
|
31
|
-
bcmd-0.5.
|
|
27
|
+
bcmd-0.5.8.dist-info/METADATA,sha256=dxjitrNJe9aAj4AoZWfaXZQPfFbagkj4MzvGjFsgp9E,475
|
|
28
|
+
bcmd-0.5.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
29
|
+
bcmd-0.5.8.dist-info/entry_points.txt,sha256=rHJrP6KEQpB-YaQqDFzEL2v88r03rxSfnzAayRvAqHU,39
|
|
30
|
+
bcmd-0.5.8.dist-info/top_level.txt,sha256=-KrvhhtBcYsm4XhcjQvEcFbBB3VXeep7d3NIfDTrXKQ,5
|
|
31
|
+
bcmd-0.5.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|