Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecated click get_terminal_size usage #71

Merged
merged 2 commits into from
Apr 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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