[Urwid] Escape sequences
Ian Ward
ian at excess.org
Thu Apr 24 23:14:57 EDT 2008
On Fri, 2008-04-25 at 01:04 +0300, Max E. Kuznecov wrote:
> 2008/4/24, Ian Ward <ian at excess.org>:
> >
> > I guess we have to do it properly then -- try the values from termcap
> > first, then fall back to the default interpretation.
> >
>
> Well, here's first quick-and-dirty patch
> The only thing I'm not quite sure about is whether it's appropriate to
> import curses in escape.py and call setupterm and tigestr(). It just
> seemed to be the easiest way, otherwise the complete terminfo-acces
> routine should be written from scratch, I suppose.
yeah, setupterm() makes no sense if urwid is run with the html_fragment
or web_display modules. Maybe this code could be put in the new base
class of curses_display.Screen and raw_display.Screen
"RealTerminal" (process_keyqueue should probably be moved there too.)
Or it could go in curses_display and eventually some other way of
getting that information could be used for raw_display.
Also, you need to handle the case where "import curses" fails.
It's a good start though :-)
Ian
More information about the Urwid
mailing list