[Urwid] Rendering and caching

Ian Ward ian at excess.org
Sat Oct 27 11:43:29 EDT 2007


Aaron Gallagher wrote:
> On Oct 26, 2007, at 7:28 AM, Ian Ward wrote:
>>> And is there any way to make text markup easier? Using lists of  
>>> markup
>>> lists is bothering me a bit.
>> I'm open to suggestions.  Would you prefer some type of escape  
>> codes in
>> the text?
> 
> I suppose that escape codes would be easier to write, but I assume  
> that it's harder for urwid to deal with those because of the way that  
> curses does formatting. Oh well, I can just write my code this way.

There's no real problem with implementing some kind of in-line markup:

"Here is some <important>brighter</important> text"
instead of:
["Here is some ", ('important', "brighter"), " text"]

I chose the latter because it meant that I would never have to worry
about escaping "special" characters in text.  If there is enough
interest in supporting something like the former example, it could be added.

Ian




More information about the Urwid mailing list