-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using rich to format output like exceptions #1216
Comments
This could easily be turned into a mixin class |
Printing exceptions with rich is a nice enhancement, but I'd rather not add rich as a requirement to use cmd2. |
I'm going to look into doing a simple mixin for this or add an example, depending on what makes sense. |
@phrrngtn I pushed up some initial structure of a rich mixin class for cmd2. Would you mind taking a look? My thought is the console.print() function can be called in poutput(). |
I did not notice the feature branch so only just found out what you are referring to. I will exercise it. My most recent deep interaction with Cmd2 was in 2011 or thereabouts. I have just used it as-is since then. |
It's a pretty minimal start that just took what you provided and puts it in a mixin. I've not used rich so I'm not really familiar with it but my thought is all of our print functions can be optionally shunted over to rich using this mixin class. |
I personally love Right now I'm not sure we want to take a dependency on it, but we should consider doing so in the future. @anselor Regardless, a mixin with an example of using it could be pretty awesome in the meantime. |
@phrrngtn Hey, just checking in again. Did you get a chance to try out the rich mixin branch? master...1216-rich-print-mixin Should be able to use it with something like:
|
Sorry but I have done absolutely nothing on this! There is a heck of a lot
of active development on Textual, a TUI framework by the people who did
rich and I have been waiting for that to be released before I start
digging into this (because one of my goals will be to run Cmd2 inside a
widget in the TUI)
I feel a bit bad about raising this issue and then doing nothing about it
but I hope I will be able to provide some answers as a by-product of the
TUI work.
thanks for checking in.
pjjH
|
No worries. I've also occasionally checked in on Textual's progress and I would love to be able to run cmd2 as the command interpreter inside of Textual Console UI. I have many project ideas if that can happen. |
I think the discussion topic #1132 could also be enabled by integrating cmd2 with Textual. |
I found my usage of Cmd2 to be enhanced by using rich to format exceptions.
The text was updated successfully, but these errors were encountered: