-
Notifications
You must be signed in to change notification settings - Fork 3
link xterm widget to python logging module #23
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
base: master
Are you sure you want to change the base?
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). |
@@ -104,9 +107,45 @@ def data(self, content): | |||
def send_line(self, line): | |||
""" convenience wrapper around send | |||
""" | |||
self.send({"content": f"{line}\r\n"}) | |||
if self.active_terminals >= 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could just be if self.active_terminals
...
@@ -104,9 +107,45 @@ def data(self, content): | |||
def send_line(self, line): | |||
""" convenience wrapper around send | |||
""" | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm.... how about buffering send
?
@@ -2,6 +2,7 @@ | |||
""" | |||
# pylint: disable=unused-argument,no-name-in-module,import-error | |||
import re | |||
import queue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we might want deque
...
"\n", | ||
" logger.debug(\"debug message\")\n", | ||
" logger.info(\"info message\")\n", | ||
" logger.warn(\"warn message\")\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning
to avoid 🐷
Need to re-investigate this, as well as a drop-in |
Extending the base xterm widget to use python's logging module.