1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 11:29:46 +03:00

core: move args.log to context.log (MR 2252)

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-05-24 18:19:07 +02:00 committed by Oliver Smith
parent 838beb270d
commit 02f04ba3a8
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
6 changed files with 28 additions and 15 deletions

View file

@ -9,6 +9,7 @@ import sys
import pmb.config
from pmb.core.types import PmbArgs
from pmb.core import get_context
class ReadlineTabCompleter:
@ -128,7 +129,7 @@ def progress_print(args: PmbArgs, progress):
filled = "\u2588" * chars
empty = " " * (width - chars)
percent = int(progress * 100)
if pmb.config.is_interactive and not args.details_to_stdout:
if pmb.config.is_interactive and not get_context().details_to_stdout:
sys.stdout.write(f"\u001b7{percent:>3}% {filled}{empty}")
sys.stdout.flush()
sys.stdout.write("\u001b8\u001b[0K")
@ -139,5 +140,5 @@ def progress_flush(args):
This will erase the line. Does nothing in non-interactive mode.
"""
if pmb.config.is_interactive and not args.details_to_stdout:
if pmb.config.is_interactive and not get_context().details_to_stdout:
sys.stdout.flush()