[Urwid] Changing Padding(width) default value in 1.1

Ian Ward ian at excess.org
Sun Dec 11 15:11:26 EST 2011


In 0.9.9 after adding the more user-friendly parameters left and right
to the Padding constructor, I also quietly gave the align and width
parameters default values of 'left' and 'pack'.

The latter has now caused problems for a number of people.  A really
common request is to just want to indent something by a few characters,
but to do that safely you need to do something like:

    urwid.Padding(my_thing, width=('relative', 100), left=4)

My preference is to change the width default to ('relative', 100) for
the next Urwid release, and add a warning for people using Padding
without specifying a width in the next bugfix release 1.0.2.

The 'pack' option only really works for Text widgets, and only makes a
difference to the appearance (as compared to ('relative', 100) when the
text alignment is different than than the padding alignment).  So I
believe the potential for breaking existing programs is low.

If this change will cause problems for you please speak up, maybe there
is some other option that won't break otherwise working code built for
0.9.9/1.0

Ian





More information about the Urwid mailing list