Skip to content
Snippets Groups Projects
Commit dcd372b3 authored by Moul's avatar Moul
Browse files

[mod] #402: history: Get terminal columns with shutil instead of click

Change from click.get_terminal_size() to shutil.get_terminal_size()
Numbers of columns can be accessed with:
the first element `[0]` and .columns attribute
parent 432cf5b3
No related branches found
No related tags found
1 merge request!184#402: Update to Click v8.0.0 and fix deprecation warning
Pipeline #12683 passed
......@@ -15,9 +15,10 @@ You should have received a copy of the GNU Affero General Public License
along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
"""
import shutil
from operator import eq, itemgetter, ne, neg
from click import argument, command, echo_via_pager, get_terminal_size, option
from click import argument, command, echo_via_pager, option
from duniterpy.api.bma.tx import history
from duniterpy.documents.transaction import Transaction
from pendulum import from_timestamp, now
......@@ -53,7 +54,7 @@ async def transaction_history(pubkey, uids, full_pubkey):
txs_list = await generate_table(
received_txs, sent_txs, pubkey, ud_value, currency_symbol, uids, full_pubkey
)
table = Texttable(max_width=get_terminal_size()[0])
table = Texttable(max_width=shutil.get_terminal_size().columns)
table.add_rows(txs_list)
await client.close()
echo_via_pager(header + table.draw())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment