[Urwid] Urwid repos, manual, display modules

Ian Ward ian at excess.org
Sun Mar 14 21:47:08 EDT 2010


Ian Ward wrote on 2010-02-25 18:11:
> On IRC a few days ago someone suggested the idea of using Urwid to drive
> a small LCD panel with a few buttons.  This person also needs the code
> to be based on Glib, which fortunately is already supported.  I quite
> like the idea, so I'm hoping to write a display module for a similar
> device[4] in the near future.

It's now possible to drive a Crystalfontz 635 with Urwid[1].  I must
say, being able to debug with print statements again is kind of nice.

[1]: http://excess.org/article/2010/03/urwid-crystalfontz-635-lcd/

I ran into an Urwid design problem I will have to fix sooner or later,
though.  Urwid has a single global setting for the encoding in use.
This doesn't work for the LCD device (which has its own, interesting
character map) and it also won't work for Ali's Twisted Conch display
(each user has their own encoding setting).

Canvases are currently rendered in the target encoding, so the best way
I can think to deal with this is to extend the size parameter of most
widget methods to include a link to the screen to which the canvas will
be rendered (maybe call it "context" instead?).

Each screen instance can have its own encoding settings, and even other
transformations applied to Unicode strings that will be displayed (It
might be nice to display entity codes for characters that
can't be displayed in the current encoding, configurable of course)

Ian



More information about the Urwid mailing list