mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Use "get_terminal_size().columns" directly
This commit is contained in:
@ -198,7 +198,7 @@ def print_processing_header(tool, envname, envdump):
|
||||
"Checking %s > %s (%s)"
|
||||
% (click.style(envname, fg="cyan", bold=True), tool, "; ".join(envdump))
|
||||
)
|
||||
terminal_width, _ = shutil.get_terminal_size()
|
||||
terminal_width = shutil.get_terminal_size().columns
|
||||
click.secho("-" * terminal_width, bold=True)
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@ def cli(query, installed, json_output): # pylint: disable=R0912
|
||||
grpboards[board["platform"]] = []
|
||||
grpboards[board["platform"]].append(board)
|
||||
|
||||
terminal_width, _ = shutil.get_terminal_size()
|
||||
terminal_width = shutil.get_terminal_size().columns
|
||||
for (platform, boards) in sorted(grpboards.items()):
|
||||
click.echo("")
|
||||
click.echo("Platform: ", nl=False)
|
||||
|
@ -125,7 +125,7 @@ class Upgrader:
|
||||
|
||||
|
||||
def after_upgrade(ctx):
|
||||
terminal_width, _ = shutil.get_terminal_size()
|
||||
terminal_width = shutil.get_terminal_size().columns
|
||||
last_version = app.get_state_item("last_version", "0.0.0")
|
||||
if last_version == __version__:
|
||||
return
|
||||
@ -221,7 +221,7 @@ def check_platformio_upgrade():
|
||||
if pepver_to_semver(latest_version) <= pepver_to_semver(__version__):
|
||||
return
|
||||
|
||||
terminal_width, _ = shutil.get_terminal_size()
|
||||
terminal_width = shutil.get_terminal_size().columns
|
||||
|
||||
click.echo("")
|
||||
click.echo("*" * terminal_width)
|
||||
@ -266,7 +266,7 @@ def check_prune_system():
|
||||
if (unnecessary_size / 1024) < threshold_mb:
|
||||
return
|
||||
|
||||
terminal_width, _ = shutil.get_terminal_size()
|
||||
terminal_width = shutil.get_terminal_size().columns
|
||||
click.echo()
|
||||
click.echo("*" * terminal_width)
|
||||
click.secho(
|
||||
|
@ -228,7 +228,7 @@ def print_processing_header(env, config, verbose=False):
|
||||
"Processing %s (%s)"
|
||||
% (click.style(env, fg="cyan", bold=True), "; ".join(env_dump))
|
||||
)
|
||||
terminal_width, _ = shutil.get_terminal_size()
|
||||
terminal_width = shutil.get_terminal_size().columns
|
||||
click.secho("-" * terminal_width, bold=True)
|
||||
|
||||
|
||||
|
@ -183,7 +183,7 @@ def print_suite_header(test_suite):
|
||||
click.style(test_suite.env_name, fg="cyan", bold=True),
|
||||
)
|
||||
)
|
||||
terminal_width, _ = shutil.get_terminal_size()
|
||||
terminal_width = shutil.get_terminal_size().columns
|
||||
click.secho("-" * terminal_width, bold=True)
|
||||
|
||||
|
||||
|
@ -186,7 +186,7 @@ def merge_dicts(d1, d2, path=None):
|
||||
|
||||
|
||||
def print_labeled_bar(label, is_error=False, fg=None, sep="="):
|
||||
terminal_width, _ = shutil.get_terminal_size()
|
||||
terminal_width = shutil.get_terminal_size().columns
|
||||
width = len(click.unstyle(label))
|
||||
half_line = sep * int((terminal_width - width - 2) / 2)
|
||||
click.secho("%s %s %s" % (half_line, label, half_line), fg=fg, err=is_error)
|
||||
|
Reference in New Issue
Block a user