Commit fa97ca6e authored by Hermann Krumrey's avatar Hermann Krumrey

Avoid overlap if terminal window is too small during download

parent 59b59421
V 4.1.0:
- Avoid overlap if terminal window is too small during download
V 4.0.0:
- Went over to completely rely on python's built-in logging
- Throttle value is now passed as parameter
......
4.0.0
\ No newline at end of file
4.1.0
\ No newline at end of file
......@@ -27,6 +27,7 @@ import irc.events
import irc.client
from colorama import Fore, Back
from threading import Thread, Lock
from subprocess import check_output, CalledProcessError
from typing import Optional, IO, Any, List, Union
from puffotter.units import human_readable_bytes, byte_string_to_byte_count
from puffotter.print import pprint
......@@ -601,6 +602,14 @@ class XDCCClient(SimpleIRCClient):
human_readable_bytes(self.filesize),
speed
)
try:
rows, _columns = check_output(['stty', 'size']).split()
columns = int(_columns)
except (ValueError, CalledProcessError):
columns = 80
log_message = log_message[0:columns]
pprint(log_message, end="\r", bg="lyellow", fg="black")
time.sleep(0.1)
self.logger.info("Progress Printer stopped")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment