plum -> fig
This commit is contained in:
parent
4d35d47969
commit
0cafdc9c6c
21 changed files with 33 additions and 33 deletions
15
fig/cli/formatter.py
Normal file
15
fig/cli/formatter.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import texttable
|
||||
import os
|
||||
|
||||
|
||||
class Formatter(object):
|
||||
def table(self, headers, rows):
|
||||
height, width = os.popen('stty size', 'r').read().split()
|
||||
|
||||
table = texttable.Texttable(max_width=width)
|
||||
table.set_cols_dtype(['t' for h in headers])
|
||||
table.add_rows([headers] + rows)
|
||||
table.set_deco(table.HEADER)
|
||||
table.set_chars(['-', '|', '+', '-'])
|
||||
|
||||
return table.draw()
|
||||
Loading…
Add table
Add a link
Reference in a new issue