warp-beacon 2.6.59__py3-none-any.whl → 2.6.61__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.
- warp_beacon/__version__.py +1 -1
- warp_beacon/telegram/progress_bar.py +16 -3
- {warp_beacon-2.6.59.dist-info → warp_beacon-2.6.61.dist-info}/METADATA +1 -1
- {warp_beacon-2.6.59.dist-info → warp_beacon-2.6.61.dist-info}/RECORD +8 -8
- {warp_beacon-2.6.59.dist-info → warp_beacon-2.6.61.dist-info}/WHEEL +0 -0
- {warp_beacon-2.6.59.dist-info → warp_beacon-2.6.61.dist-info}/entry_points.txt +0 -0
- {warp_beacon-2.6.59.dist-info → warp_beacon-2.6.61.dist-info}/licenses/LICENSE +0 -0
- {warp_beacon-2.6.59.dist-info → warp_beacon-2.6.61.dist-info}/top_level.txt +0 -0
warp_beacon/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = "2.6.
|
1
|
+
__version__ = "2.6.61"
|
2
2
|
|
@@ -34,7 +34,15 @@ class ProgressBar(object):
|
|
34
34
|
pbar = '█' * filled + half_block + '─' * (length - filled - len(half_block))
|
35
35
|
percent = frac * 100
|
36
36
|
return f"<b>[{pbar}] {round(percent)}%</b>"
|
37
|
-
|
37
|
+
|
38
|
+
def format_size_si(self, bytes_num: int) -> str:
|
39
|
+
units = [("TB", 1024**4), ("GB", 1024**3), ("MB", 1024**2), ("KB", 1024), ("B", 1)]
|
40
|
+
for unit_name, unit_value in units:
|
41
|
+
if bytes_num >= unit_value:
|
42
|
+
value = bytes_num / unit_value
|
43
|
+
return f"{value:.2f} {unit_name}"
|
44
|
+
return "0 B"
|
45
|
+
|
38
46
|
def make_emoji_progress_bar(self, percent: int, length: int = 10) -> str:
|
39
47
|
"""
|
40
48
|
Builds an emoji progress bar.
|
@@ -68,13 +76,18 @@ class ProgressBar(object):
|
|
68
76
|
return
|
69
77
|
if total == 0 or percent >= self._next_threshold:
|
70
78
|
#pbar = self.make_progress_bar(percent, 100, 25)
|
71
|
-
pbar = self.make_emoji_progress_bar(percent,
|
79
|
+
pbar = self.make_emoji_progress_bar(percent, 10)
|
72
80
|
logging.info("[Progress bar]: Operation: %s %d%%", operation, percent)
|
73
81
|
try:
|
74
82
|
#await self.client.edit_message_caption(chat_id, message_id, f"{pbar} <b>{operation}</b> {label}", ParseMode.HTML)
|
75
83
|
# we don't need to wait completion, waste of time and resources
|
84
|
+
text = f"{pbar}\n<b>{operation}</b>"
|
85
|
+
if label:
|
86
|
+
text += f"\n{label}"
|
87
|
+
if total:
|
88
|
+
text += f" {self.format_size_si(total)}"
|
76
89
|
task = self.client.loop.create_task(
|
77
|
-
self.client.edit_message_caption(chat_id, message_id,
|
90
|
+
self.client.edit_message_caption(chat_id, message_id, text, ParseMode.HTML)
|
78
91
|
)
|
79
92
|
task.add_done_callback(self._on_edit_done)
|
80
93
|
except MessageNotModified:
|
@@ -4,7 +4,7 @@ var/warp_beacon/accounts.json,sha256=OsXdncs6h88xrF_AP6_WDCK1waGBn9SR-uYdIeK37GM
|
|
4
4
|
var/warp_beacon/placeholder.gif,sha256=cE5CGJVaop4Sx21zx6j4AyoHU0ncmvQuS2o6hJfEH88,6064
|
5
5
|
var/warp_beacon/proxies.json,sha256=VnjlQDXumOEq72ZFjbh6IqHS1TEHqn8HPYAZqWCeSIA,95
|
6
6
|
warp_beacon/__init__.py,sha256=_rThNODmz0nDp_n4mWo_HKaNFE5jk1_7cRhHyYaencI,163
|
7
|
-
warp_beacon/__version__.py,sha256=
|
7
|
+
warp_beacon/__version__.py,sha256=NHCyNektha5AoHntZWrB2Tszke4MQTtV0I9xIgSjsBM,24
|
8
8
|
warp_beacon/warp_beacon.py,sha256=ED43vNzdjDUJ_9qLCbri0bjWLWEJ69BENGj9i7G6AvM,342
|
9
9
|
warp_beacon/yt_auth.py,sha256=GUTKqYr_tzDC-07Lx_ahWXSag8EyLxXBUnQbDBIkEmk,6022
|
10
10
|
warp_beacon/compress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -46,13 +46,13 @@ warp_beacon/telegram/download_status.py,sha256=dV0mRIOkA8dU0ECsmC_rZ33XQhVnkW2nZ
|
|
46
46
|
warp_beacon/telegram/edit_message.py,sha256=SB3qKLCfO5mgeeASKVf9VY21JG0SuwuX8okQXPYA2Dk,5415
|
47
47
|
warp_beacon/telegram/handlers.py,sha256=uvR6TPHSqdSxigp3wR-ewiE6t3TvVcbVLVcYGwkgD2s,9559
|
48
48
|
warp_beacon/telegram/placeholder_message.py,sha256=wN9-BRiyrtHG-EvXtZkGJHt2CX71munQ57ITttjt0mw,6400
|
49
|
-
warp_beacon/telegram/progress_bar.py,sha256=
|
49
|
+
warp_beacon/telegram/progress_bar.py,sha256=hVr-VmfVadRTRtzfChqCigCKT_4KRlKqT-dJxi5U9dc,3590
|
50
50
|
warp_beacon/telegram/progress_file_reader.py,sha256=e3equyNKlKs764AD-iE9QRsh3YDHTzP78Mx5tdvPPWs,969
|
51
51
|
warp_beacon/telegram/utils.py,sha256=1Lq67aRylVJzbwSyvAgjPAGjJZFATkICvAj3TJGuJiM,4635
|
52
52
|
warp_beacon/uploader/__init__.py,sha256=j3qcuKhpchseZLGzSsSiogqe6WdMbkK8d3I-ConhNRs,5687
|
53
|
-
warp_beacon-2.6.
|
54
|
-
warp_beacon-2.6.
|
55
|
-
warp_beacon-2.6.
|
56
|
-
warp_beacon-2.6.
|
57
|
-
warp_beacon-2.6.
|
58
|
-
warp_beacon-2.6.
|
53
|
+
warp_beacon-2.6.61.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
54
|
+
warp_beacon-2.6.61.dist-info/METADATA,sha256=Cg_I66fjNJIPa2mXx6xlfaAyDd8Dy9DU-MNhy-XPpEU,22706
|
55
|
+
warp_beacon-2.6.61.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
56
|
+
warp_beacon-2.6.61.dist-info/entry_points.txt,sha256=eSB61Rb89d56WY0O-vEIQwkn18J-4CMrJcLA_R_8h3g,119
|
57
|
+
warp_beacon-2.6.61.dist-info/top_level.txt,sha256=2x4wBJ_HeeBt6Bsdu9C4tItXWqH8spX8jGSHpoL0IMw,1334
|
58
|
+
warp_beacon-2.6.61.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|