[IPython-dev] Frontend: curses or urwid?
Mon Mar 22 04:13:47 CDT 2010
I have been looking at urwid and curses, and I think my first
impressions of urwid were quite wrong. It looks like it could actually
be an excellent basis for a curses frontend - its widgets are extremely
useful, and its text editing capabilities are well beyond that of the
normal curses. Its documentation is not the best, and is more detail
oriented than big-picture oriented, but I think I've now seen that big
picture and can work with it.
I sent an email to one of the urwid developers asking about python 3
support, and have attached his reply - basically, someone is working on
'cleanup related to python 3 support', but there is no clear picture as
to when py3k will be supported.
Urwid does generally use its own main-loop, but after digging around, it
seems fairly trivial to instead incorporate urwid into a different main
loop; examples are given in the source code for incorporation into
twisted, for example.
The other problem with it (also addressed in the attached email) is that
it gives error messages that are extremely unhelpful - giving little
more information than that the error is urwid related. However, if we
did decide to go with urwid, I think this would turn out ok - we only
need a few widgets: a box for interpreter output, a box for text input,
and a pop-up window for completions/help. Urwid would make this much
easier than plain curses.
So those are the pros and cons: urwid would be very easy to use now, and
would also greatly simplify the code related to the frontend - but with
unknown python 3 support, unhelpful error messages when it does break,
and all the other downsides of another dependency.
This is a big decision: urwid is very different from plain curses, and
it would be very difficult to switch later. What do you think?
-------------- next part --------------
An embedded message was scrubbed...
From: Ian Ward <firstname.lastname@example.org>
Subject: Re: Using urwid for an ipython frontend
Date: Sun, 21 Mar 2010 16:05:45 -0400
More information about the IPython-dev