mirror of
https://github.com/docker/compose.git
synced 2025-07-25 22:54:54 +02:00
change 80 to 0
Signed-off-by: Erik Kristensen <erik@erikkristensen.com>
This commit is contained in:
parent
b7edb3ca9d
commit
7937611366
@ -3,9 +3,18 @@ from __future__ import absolute_import
|
|||||||
import os
|
import os
|
||||||
import texttable
|
import texttable
|
||||||
|
|
||||||
|
|
||||||
|
def get_tty_width():
|
||||||
|
tty_size = os.popen('stty size', 'r').read().split()
|
||||||
|
if len(tty_size) != 2:
|
||||||
|
return 0
|
||||||
|
_, width = tty_size
|
||||||
|
return int(width)
|
||||||
|
|
||||||
|
|
||||||
class Formatter(object):
|
class Formatter(object):
|
||||||
def table(self, headers, rows):
|
def table(self, headers, rows):
|
||||||
table = texttable.Texttable(max_width=0)
|
table = texttable.Texttable(max_width=get_tty_width())
|
||||||
table.set_cols_dtype(['t' for h in headers])
|
table.set_cols_dtype(['t' for h in headers])
|
||||||
table.add_rows([headers] + rows)
|
table.add_rows([headers] + rows)
|
||||||
table.set_deco(table.HEADER)
|
table.set_deco(table.HEADER)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user