Alain Leufroy wrote on 2011-08-16 07:11: > Hi, > > I'd like to use pygments to colorize source file data displayed in a Text > widget. > > To do so, I set a palette with names from pygments tokens. Here is a simple > example:: > ... > > Running ``python test.py`` displays a highlighted source code. But it is not > exactly what as I expect. > > For example, *Foo* is not highlighted because pygments sets the "style" to > *token.Token.Name.Class*. But I'd like that *Foo* is in "dark blue" because > *token.Token.Name.Class* is a "sub-style" of *token.Token.Name* (instead of > defining all "sub-style of "token.Token.Name" to the same style). > > From now urwid stores the palette in a dictionary (ex: raw_display.py line 51 > changeset d6d6ae081dcf of https://excess.org/hg/urwid/). > Is it possible to add a way to tune the palette container for a dict-like > class > that suite special needs?
Hi Alain, I suppose you could replace the _palette dictionary in your screen with your own dictionary-like object that does that sort of advanced lookup. Ian _______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
