Closed chhsiao90 closed 8 years ago
The following list some wish list that I would love to have in tui-viewer.
...
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatter import Terminal256Formatter
class JsonFormatter(object):
...
def colorize(self, raw_text):
lexer = get_lexer_by_name("json", stripall=True)
formatter = Terminal256Formatter()
return highligh(raw_text, lexer, formatter)
def format_body(self, body):
parsed_body = json.loads(...)
json_string = json_dumps(...)
return self.colorize(json_string)
...
The output would look something like this.
?[38;5;28;01m"data"?[39;00m: {
?[38;5;28;01m"total"?[39;00m: ?[38;5;241m3?[39m,
?[38;5;28;01m"hosts"?[39;00m: [
{
?[38;5;28;01m"index"?[39;00m: [
?[38;5;124m"index.html"?[39m,
?[38;5;124m"index.htm"?[39m,
?[38;5;124m"index.cgi"?[39m,
?[38;5;124m"index.php"?[39m,
?[38;5;124m"index.php5"?[39m
],
There is a thread talking about the pygments styles working with urwid.
http://lists.excess.org/pipermail/urwid/2011-August/001092.html
The list you provide that all make sense. I will add them into next release. Thanks!
Thank you for your help, thanks
I planned release GViewer v3.0.0 recently. That could support functionality for: #155 , #116
Do you have any other idea or suggestion that could be implement in gviewer that microproxy need?