Skip to content

2.4.2

Compare
Choose a tag to compare
@penguinolog penguinolog released this 11 Jan 14:50
· 231 commits to master since this release
271b801

What's Changed

New features 🗹

Now it possible to quick check incomplete widgets prototypes without size counting like:

>>> import urwid
>>> grid = urwid.GridFlow(
   ...:             (urwid.Button(tag, align=urwid.CENTER) for tag in ("OK", "Cancel", "Help")),
   ...:             cell_width=10,
   ...:             h_sep=1,
   ...:             v_sep=1,
   ...:             align=urwid.CENTER,
   ...:         )
>>> body = urwid.Pile(
   ...:             (
   ...:                 (urwid.Text("Window content text here and it should not touch line", align=urwid.CENTER)),
   ...:                 (urwid.PACK, grid),
   ...:             )
   ...:         )
>>> widget = urwid.LineBox(
   ...:             urwid.Pile(
   ...:                 (
   ...:                     urwid.Text("Some window", align=urwid.CENTER),
   ...:                     urwid.Divider("─"),
   ...:                     urwid.Padding(body, width=urwid.PACK, left=1, right=1),
   ...:                 )
   ...:             )
   ...:         )
>>> print(b"\n".join(widget.render(()).text).decode("utf-8"))
┌───────────────────────────────────────────────────────┐
│                      Some window                      │
│───────────────────────────────────────────────────────│
│ Window content text here and it should not touch line │
│           <   OK   > < Cancel > <  Help  >            │
└───────────────────────────────────────────────────────┘

>>> widget.pack(())
(57, 6)

Bug fixes 🕷

  • BUG: Columns with GIVEN width == 0 should not count in rows by @penguinolog in #736

Refactoring 🛠

  • Remove unused deprecated "test_suite" directive from setup.py by @penguinolog in #729

Full Changelog: 2.4.1...2.4.2