eyeonus / Trade-Dangerous

Mozilla Public License 2.0
97 stars 31 forks source link

qol: enable rich text #121

Closed kfsone closed 5 months ago

kfsone commented 5 months ago

This change enables features of Python's "rich" text manipulation library, which provides a provides things like spinners, progress bars, but most importantly console-aware colorization and markup.

One of the nicer aspects of Rich is that it's designed for console applications like TD which want to retain automation support; you don't have to write everything as multiple branches to say "if we're not output to a console, work like this", etc.

With this change we will immediately get things like native colorization of links in the output to console, some syntax highlighting in things like the exporters etc, and my change also makes it so that: a- DEBUGn lines are dimmed to make them less intrusive, b- NOTE lines are boldened to make them stand out, c- WARNING lines are colored orange,

kfsone commented 5 months ago

image

Before: image

After, with $EXCEPTIONS set to something: image

kfsone commented 5 months ago

If you crank up the debugging, it gives a lot of additional (helpful) backtrace info too:

image

kfsone commented 5 months ago

Oh, that's weird. I think I know why this is happening. May need to adjust tox.ini.

kfsone commented 5 months ago

This will depend on the tox fix that I made in the other branch.

Squashing this one and rebasing it.