You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ju...@apache.org on 2022/01/16 14:46:27 UTC
[buildstream] branch master updated: _frontend/status.py: use shutil.get_terminal_size()
This is an automated email from the ASF dual-hosted git repository.
juergbi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/buildstream.git
The following commit(s) were added to refs/heads/master by this push:
new b191845 _frontend/status.py: use shutil.get_terminal_size()
new 2e7328c Merge pull request #1545 from abderrahim/terminal_size
b191845 is described below
commit b19184525f31b9984f915e78526809a34e43b909
Author: Abderrahim Kitouni <ak...@gnome.org>
AuthorDate: Sun Dec 12 16:56:05 2021 +0100
_frontend/status.py: use shutil.get_terminal_size()
click.get_terminal_size() is deprecated and the shutil version is available
since python 3.3
---
src/buildstream/_frontend/status.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/buildstream/_frontend/status.py b/src/buildstream/_frontend/status.py
index a1f9e3d..b0d3254 100644
--- a/src/buildstream/_frontend/status.py
+++ b/src/buildstream/_frontend/status.py
@@ -19,6 +19,7 @@ import os
import sys
import curses
from collections import OrderedDict
+import shutil
import click
# Import a widget internal for formatting time codes
@@ -63,7 +64,7 @@ class Status:
context, state, content_profile, format_profile, success_profile, error_profile, stream
)
- self._term_width, _ = click.get_terminal_size()
+ self._term_width, _ = shutil.get_terminal_size()
self._alloc_lines = 0
self._alloc_columns = None
self._need_alloc = True
@@ -215,7 +216,7 @@ class Status:
return term_caps
def _check_term_width(self):
- term_width, _ = click.get_terminal_size()
+ term_width, _ = shutil.get_terminal_size()
if self._term_width != term_width:
self._term_width = term_width
self._need_alloc = True