[Urwid] The missing part of my last mail
Ian Ward
ian at excess.org
Mon May 29 17:51:59 EDT 2006
Rebecca Breu wrote:
> On the web page you write that one needs Python 2.1 or higher in order to use
> urwid. But when I ran my program with Python 2.2.0, I had to do some slight
> modifications to the urwid code:
>
> 1.) The curses module doen't recognize window resizing. Thus, cuses.KEY_RESIZE
> doesn't exist. (in curses_display.get_input)
Really? I thought python >= 2.1 had support for resizing.
Python 2.1.3+ (#1, Sep 5 2005, 22:16:03)
[GCC 4.0.2 20050808 (prerelease) (Debian 4.0.1-4ubuntu6)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import curses
>>> curses.KEY_RESIZE
410
It seems to work for me. Maybe the version of Python you're running is
linked against the curses library, not the ncurses library.
The raw_display module should work regardless of which curses is linked
against Python.
> 2.) Old Python doesn't like "<string> in <string>", only "<char> in <string>".
> In escape.process_keyqueue (line 257), I changed
>
> if run[0] == "esc" or "meta " in run[0]:
>
> to
>
> if run[0] == "esc" or run[0].find("meta " ) >= 0:
You're right. Thank you! I've fixed that for the next release.
Ian Ward
More information about the Urwid
mailing list