bcmd 0.5.7__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 CHANGED
@@ -6,5 +6,5 @@ from .tasks import *
6
6
 
7
7
 
8
8
  def run():
9
- btask.options.lock = 0
9
+ btask.options.lock = 0 # 允许多开
10
10
  asyncio.run(btask.main())
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
- compression: int = typer.Option(75, '--compression', help='如果压缩小于指定数值则使用原来的图片,单位:%,默认75'),
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
- bcolor.printYellow(f'{file.file}({file.compression - 100:.2f}% / 已压缩 / {file.getSizeDisplay()})')
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,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: bcmd
3
- Version: 0.5.7
3
+ Version: 0.5.8
4
4
  Summary: Commands for Beni
5
5
  Author-email: Beni Mang <benimang@126.com>
6
6
  Maintainer-email: Beni Mang <benimang@126.com>
@@ -1,5 +1,5 @@
1
1
  bcmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- bcmd/main.py,sha256=1HRCHLt_jeF6ImgjG_MX9N2x9H1f6FyqTX7UADzedfA,131
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
@@ -14,7 +14,7 @@ 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=Po8jpEf4e1X68oJc2MYT446o-45RgIrl1TsODvUetBo,7782
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.7.dist-info/METADATA,sha256=VYojYhON5P2o-Vmd9J-I3tOCdWTVYqR4R6uqplVK8JI,475
28
- bcmd-0.5.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
29
- bcmd-0.5.7.dist-info/entry_points.txt,sha256=rHJrP6KEQpB-YaQqDFzEL2v88r03rxSfnzAayRvAqHU,39
30
- bcmd-0.5.7.dist-info/top_level.txt,sha256=-KrvhhtBcYsm4XhcjQvEcFbBB3VXeep7d3NIfDTrXKQ,5
31
- bcmd-0.5.7.dist-info/RECORD,,
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