Goffi wrote on 2011-10-02 17:28:
> Unfortunately, I have bad news: after somebody used my XMPP client (with
> a console frontend based on Urwid) he contacted me because of crashes.
> I saw he was using the new version, so I upgraded, and realized that my
> frontend (primitivus, see http://wiki.goffi.org/wiki/Salut_%C3%A0_Toi if
> you want the sources) is broken with this version.
>
> I haven't tracked everything yet, but
>
> - the method is_mouse_press is not available any more. After quickly
> watching the sources, it seems to be now in urwid.util , but I see no
> mention of that in the CHANGELOG.
I switched the __init__.py to explicitly export all its symbols and I
forgot to include is_mouse_press. Now fixed in development and it will
be in 1.0.1.
A workaround would be to import is_mouse_press from urwid.util.
> - I have crashed in my app when I pressed an unicode key (like the
> french "é"). I quickly looked the code and saw in widget.py, line 983
> and beyong:
>
> tu = isinstance(text, unicode)
> [...]
> if tu:
> return text.encode('ascii') # follow python2's implicit
> conversion <=== crash
>
> if tu is unicode, the crash is normal (the line should be "return
> text.encode('utf-8')"), but I'm not sure to understand the intention
> here, so it probably need more investigation.
Edit widgets now try to convert their edit_text to the same type
(unicode or bytes) as their captions. If the caption is unicode but
input received is bytes (because the terminal isn't detected to be in
UTF-8 mode) then that line will run. The proper fix is probably to use
the detected encoding instead of 'ascii'.
Are you sure your terminal is detected as using utf-8? what does
import urwid; print urwid.get_encoding_mode()
say?
A workaround is to set your caption to '' (or any byte string) which was
the default in 0.9.9. For the best compatibility I'd have to change
that back, but byte strings really aren't a good default for edit widgets.
> - I see that there is now a Password widget, and I did one in my urwid
> library (Urwid Satext: http://wiki.goffi.org/wiki/Urwid-satext ); is it
> not possible to include this library directly into Urwid ? It will
> definitely need some work to follow urwid's coding style, and some tests
> additions, but it would avoid working two times on similar widgets like
> this. The issue is I too busy to work on it at the moment :(.
We're talking about a few lines of code. I don't think that's a big
duplication problem :-) But, of course I'm happy to consider patches
to Urwid with new widgets. That's how the tree widgets were added to 1.0.0
Ian
_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid