From 3cdb23c584f48582593f2ccd22491579fc190729 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Thu, 16 Mar 2023 21:42:26 -0500 Subject: [PATCH] upgrade-prettytable, use colored table --- setup.py | 2 +- slither/utils/myprettytable.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 0d26167b35..ccab5a21a1 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ python_requires=">=3.8", install_requires=[ "packaging", - "prettytable>=0.7.2", + "prettytable>=3.3.0", "pycryptodome>=3.4.6", # "crytic-compile>=0.3.0", "crytic-compile@git+https://github.com/crytic/crytic-compile.git@master#egg=crytic-compile", diff --git a/slither/utils/myprettytable.py b/slither/utils/myprettytable.py index a1dfd7ac01..60eed182ea 100644 --- a/slither/utils/myprettytable.py +++ b/slither/utils/myprettytable.py @@ -1,6 +1,6 @@ from typing import List, Dict -from prettytable import PrettyTable +from prettytable.colortable import ColorTable, Themes class MyPrettyTable: @@ -11,8 +11,8 @@ def __init__(self, field_names: List[str]): def add_row(self, row: List[str]) -> None: self._rows.append(row) - def to_pretty_table(self) -> PrettyTable: - table = PrettyTable(self._field_names) + def to_pretty_table(self) -> ColorTable: + table = ColorTable(self._field_names, theme=Themes.OCEAN) for row in self._rows: table.add_row(row) return table