Merge pull request #1766 from crytic/upgrade-pretty-table

upgrade-prettytable, use colored table
pull/1915/head
Feist Josselin 2 years ago committed by GitHub
commit 2670e0a9fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      setup.py
  2. 6
      slither/utils/myprettytable.py

@ -13,7 +13,7 @@ setup(
python_requires=">=3.8",
install_requires=[
"packaging",
"prettytable>=0.7.2",
"prettytable>=3.3.0",
"pycryptodome>=3.4.6",
# "crytic-compile>=0.3.1,<0.4.0",
"crytic-compile@git+https://github.com/crytic/crytic-compile.git@windows-rel-path#egg=crytic-compile",

@ -1,6 +1,6 @@
from typing import List, Dict, Union
from prettytable import PrettyTable
from prettytable.colortable import ColorTable, Themes
class MyPrettyTable:
@ -11,8 +11,8 @@ class MyPrettyTable:
def add_row(self, row: List[Union[str, 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

Loading…
Cancel
Save