link xterm widget to python logging module#23
Conversation
|
Thanks, this looks great. Much lint: will look into it when i get a chance... |
|
Behind that lint is yet more lint. Needs further investigation. Some questions:
In the demo:
|
|
I went ahead and moved the buffer to the Terminal class and expanded the demo so it should be more factory like and also demonstrate how to do some styling. Also you can pass in any of the named pygment styles either as a string or by their class. I am not sure about widgetizing the color formatter, but it might cleanup the expanded demo a bit. I also am not sure about subclassing the terminal directly yet versus the current XStream shim... not sure what the impact to logging flexibility would be. |
|
Checking on binder (also added link up top). |
| """ convenience wrapper around send | ||
| """ | ||
| self.send({"content": f"{line}\r\n"}) | ||
| if self.active_terminals >= 1: |
There was a problem hiding this comment.
could just be if self.active_terminals...
| """ | ||
| self.send({"content": f"{line}\r\n"}) | ||
| if self.active_terminals >= 1: | ||
| self.send({"content": f"{line}\r\n"}) |
There was a problem hiding this comment.
hm.... how about buffering send?
| """ | ||
| # pylint: disable=unused-argument,no-name-in-module,import-error | ||
| import re | ||
| import queue |
There was a problem hiding this comment.
i wonder if we might want deque...
| "\n", | ||
| " logger.debug(\"debug message\")\n", | ||
| " logger.info(\"info message\")\n", | ||
| " logger.warn(\"warn message\")\n", |
|
Need to re-investigate this, as well as a drop-in |
Extending the base xterm widget to use python's logging module.