Machine: use table for list outputs(#6892)

fix: #6892

Current output of machine list is quite urgly, it is originaly used to
show configurations. In this PR, we use a new table format for it.
This commit is contained in:
karajan1001
2021-11-18 11:22:13 +08:00
committed by Gao
parent 45553c5b30
commit b24a31b834
6 changed files with 93 additions and 51 deletions
+15
View File
@@ -54,3 +54,18 @@ def clean_staging():
)
except FileNotFoundError:
pass
@contextmanager
def console_width(console, width):
console_options = console.options
original = console_options.max_width
con_width = console._width
try:
console_options.max_width = width
console._width = width
yield
finally:
console_options.max_width = original
console._width = con_width