forked from DRMTalks/devine
Shorten variable `aria_log_buffer` to `log_buffer`
This commit is contained in:
parent
90818f201d
commit
7ca58c96ab
|
@ -102,7 +102,7 @@ async def aria2c(
|
||||||
|
|
||||||
if p.stdout:
|
if p.stdout:
|
||||||
is_dl_summary = False
|
is_dl_summary = False
|
||||||
aria_log_buffer = ""
|
log_buffer = ""
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
chunk = await p.stdout.readuntil(b"\r")
|
chunk = await p.stdout.readuntil(b"\r")
|
||||||
|
@ -135,16 +135,16 @@ async def aria2c(
|
||||||
elif not is_dl_summary:
|
elif not is_dl_summary:
|
||||||
if "aria2 will resume download if the transfer is restarted" in line:
|
if "aria2 will resume download if the transfer is restarted" in line:
|
||||||
continue
|
continue
|
||||||
aria_log_buffer += f"{line.strip()}\n"
|
log_buffer += f"{line.strip()}\n"
|
||||||
|
|
||||||
if aria_log_buffer:
|
if log_buffer:
|
||||||
# wrap to console width - padding - '[Aria2c]: '
|
# wrap to console width - padding - '[Aria2c]: '
|
||||||
aria_log_buffer = "\n ".join(textwrap.wrap(
|
log_buffer = "\n ".join(textwrap.wrap(
|
||||||
aria_log_buffer.rstrip(),
|
log_buffer.rstrip(),
|
||||||
width=console.width - 20,
|
width=console.width - 20,
|
||||||
initial_indent=""
|
initial_indent=""
|
||||||
))
|
))
|
||||||
console.log(Text.from_ansi("\n[Aria2c]: " + aria_log_buffer))
|
console.log(Text.from_ansi("\n[Aria2c]: " + log_buffer))
|
||||||
|
|
||||||
await p.wait()
|
await p.wait()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue