Skip to content

Commit

Permalink
Fix deprecated click get_terminal_size usage (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
nazywam committed Apr 18, 2022
1 parent 04c2fba commit ad08161
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mwdblib/cli/formatters/tabular.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import shutil

import beautifultable
import click
Expand All @@ -17,7 +18,7 @@

class TabularFormatter(ObjectFormatter):
def format_attr_table(self, data):
term_width, term_height = click.get_terminal_size()
term_width, term_height = shutil.get_terminal_size()
table = beautifultable.BeautifulTable(
maxwidth=term_width, default_alignment=beautifultable.ALIGN_LEFT
)
Expand All @@ -30,7 +31,7 @@ def format_attr_table(self, data):
return str(table)

def format_table(self, headers, widths, row_formatter, rows):
term_width, term_height = click.get_terminal_size()
term_width, term_height = shutil.get_terminal_size()
table = beautifultable.BeautifulTable(
maxwidth=term_width, default_alignment=beautifultable.ALIGN_LEFT
)
Expand Down

0 comments on commit ad08161

Please sign in to comment.