Enhance logging and progress handling in SSH operations

- Updated the `_log_default` function to handle messages starting with `\r` for in-place updates.
- Introduced `split_ssh_stream` to differentiate between line and progress events in SSH output.
- Implemented `feed_ssh_log` to dispatch log messages based on event type.
- Refactored `_stream_pty_output` to utilize the new logging and event handling functions.
- Enhanced the `log` function in `term.py` to support progress updates, ensuring a cleaner output experience.
- Updated `DownloadProgress` classes in `civitai_fetch.py` and `llamacpp_fetch.py` to print progress in place, improving user feedback during downloads.
This commit is contained in:
Leonid Pershin
2026-08-21 07:20:28 +03:00
parent 4186d0bcf1
commit aca8d5e990
7 changed files with 196 additions and 29 deletions
+3
View File
@@ -54,6 +54,9 @@ Log = Callable[[str], None]
def _log_default(msg: str) -> None:
if msg.startswith("\r"):
print("\r" + msg[1:], end="", flush=True)
return
print(msg)