Use urwid constants for widgets instead of string equivalents

* Reduce `DeprecationWarning` amount:
  `get_focus` -> `focus_position` for `Frame` and `focus` for `Pile`
  `set_focus` -> use property `focus_position`
This commit is contained in:
Aleksei Stepanov 2024-01-18 11:58:22 +01:00
parent d856f3fd28
commit 77eca5d23e
11 changed files with 524 additions and 245 deletions

View file

@ -4,7 +4,6 @@ import random
import time
from urwid.util import is_mouse_press
from urwid.text_layout import calc_coords
import re
DEFAULT_FG_DARK = "ddd"
DEFAULT_FG_LIGHT = "222"
@ -162,7 +161,7 @@ def parse_line(line, state, url_delegate):
else:
tw = urwid.Text(o, align=state["align"])
widgets.append(("pack", tw))
widgets.append((urwid.PACK, tw))
else:
if o["type"] == "field":
fw = o["width"]