-
Notifications
You must be signed in to change notification settings - Fork 69
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
colored error messages for "larch -r -c" #65
Comments
I'm completely willing to add that as a "use if available" option, and add termcolor as a recommended option. |
For a simple string color print without any dependence, here my two cents: https://github.com/maurov/larch_plugins/blob/master/std/cprint.py I simply translated in Python what we do here at ESRF under SPEC. Maybe it is not elegant, but it works under Linux, no idea under Windows. |
Hi Mauro, Bruce, On Mon, Nov 25, 2013 at 2:20 AM, Mauro Rovezzi notifications@github.comwrote:
Thanks. I think termcolor does (mostly?) the same sort of thing, inserting The termcolor module does not work with a plain MS Windows shell (cmd.exe), Anyway, getting this to work on Windows would be a bit of work, but that at any time to alter the results. it seems that not all of these options |
This claims to work on Windows: |
Matt, thanks for implementing this so quickly. I really wish I had thought to ask for this ages ago. So much easier to debug Athena! |
Hmm, I just downloaded and tried this and it totally put Python in an Those of us who sometimes develop on Windows are doomed. I myself often |
I am leaving an issue rather than making a pull request because I am pretty sure the hack I made is not the best way to implement what I am looking for. It is very handy that the larch server can be made to echo with the
-c
flag. However, finding the error among a mountain of text is rather difficult. So I modifiedlib/larchlib.py
in two ways. First, at the top, I didthen, as the return for
get_error
, I didVery helpful for troubleshooting Athena!
I have no idea whether that'll work on Windows. And you may want to use a command line flag or some other configuration to turn the coloring on and off. Also, it seems that termcolor is not part of a standard python installation, so it would have to be a recommended dependency. In short, I'm just not sure the best way to implement this.
It may be a more broadly useful dependency, though. Some color in the REPL may be quite nice.
I should say that I used termcolor because it was the first suggestion in an article on Stack Overflow
The text was updated successfully, but these errors were encountered: