Skip to content

replace tqdm, termcolor, tabulate with rich - #2374

Merged
williballenthin merged 22 commits into
mandiant:masterfrom
fariss:use-rich
Sep 27, 2024
Merged

replace tqdm, termcolor, tabulate with rich#2374
williballenthin merged 22 commits into
mandiant:masterfrom
fariss:use-rich

Conversation

@fariss

@fariss fariss commented Sep 17, 2024

Copy link
Copy Markdown
Collaborator

closes #2100

Checklist

  • No CHANGELOG update needed
  • No new tests needed
  • No documentation update needed

Comment thread capa/__init__.py Outdated
Comment on lines -150 to -152
# Ghidrathon interpreter cannot properly handle
# the TMonitor thread that is created via a monitor_interval
# > 0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before merge we'll have to test and ensure the new implementation also works under Ghidra, which has some weird restrictions.

Comment thread capa/render/vverbose.py Outdated
Comment thread scripts/lint.py
Comment thread tests/test_render.py
@mr-tz

mr-tz commented Sep 20, 2024

Copy link
Copy Markdown
Collaborator

Let's also add a few more rendering tests and test_main_non_ascii_filename_nonexistent needs to be fixed.

@fariss
fariss marked this pull request as ready for review September 24, 2024 14:21

@williballenthin williballenthin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please address the logging configuration comments, and then we're ready to go! thanks @s-ff

Comment thread capa/main.py Outdated
Comment thread capa/main.py Outdated
Comment thread capa/main.py Outdated
Comment thread capa/render/utils.py

@williballenthin williballenthin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Comment thread capa/main.py
logging.basicConfig(level=logging.DEBUG)
logging.getLogger().setLevel(logging.DEBUG)
else:
logging.basicConfig(level=logging.INFO)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good fix, thanks for remembering this

Comment thread capa/main.py

# use RichHandler for root logger
logging.getLogger().addHandler(rich_handler)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, thank you!

@williballenthin
williballenthin merged commit 51a4eb4 into mandiant:master Sep 27, 2024
@mr-tz

mr-tz commented Sep 27, 2024

Copy link
Copy Markdown
Collaborator

Thanks, the new output looks great in my testing so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use rich to replace tqdm, tabulate, termcolor, etc.

3 participants