urwid 5.1.1__tar.gz → 5.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {urwid-5.1.1 → urwid-5.1.2}/PKG-INFO +1 -1
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/curses.py +10 -2
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/escape.py +29 -6
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/asyncio_loop.py +11 -8
- {urwid-5.1.1 → urwid-5.1.2}/urwid/version.py +3 -3
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/constants.py +18 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/divider.py +6 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/scrollable.py +6 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/spinner.py +6 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/tabs.py +6 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/treetools.py +6 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/wimp.py +37 -1
- {urwid-5.1.1 → urwid-5.1.2}/urwid.egg-info/PKG-INFO +1 -1
- urwid-5.1.2/urwid.egg-info/scm_version.json +8 -0
- urwid-5.1.1/urwid.egg-info/scm_version.json +0 -8
- {urwid-5.1.1 → urwid-5.1.2}/.devcontainer/dev.dockerfile +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.devcontainer/devcontainer.json +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.devcontainer/docs-pdf/devcontainer.json +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.dockerignore +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.editorconfig +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/CODE_OF_CONDUCT.md +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/ISSUE_TEMPLATE/docs.md +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/ISSUE_TEMPLATE/question.md +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/dependabot.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/labeler.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/release.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/workflows/documentation-pdf.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/workflows/documentation.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/workflows/isolated_mypy.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/workflows/isolated_pylint.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/workflows/isolated_pyrefly.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/workflows/labels.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/workflows/pythonpackage.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.github/workflows/yamllint.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.gitignore +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.pre-commit-config.yaml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/.yamllint.yml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/COPYING +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/MANIFEST.in +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/README.rst +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/SECURITY.md +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/classifiers.txt +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/conftest.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/mypy-requirements.txt +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/pylint-requirements.txt +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/pyproject.toml +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/pyrefly-requirements.txt +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/pytest_requirements.txt +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/requirements.txt +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/setup.cfg +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/tox.ini +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/__init__.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/_deprecation.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/_selectors.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/ansi_parser.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/canvas.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/command_map.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/__init__.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_posix_raw_display.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_raw_display_base.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_web.css +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_web.js +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_web_common.js +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_web_common.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_websocket.css +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_websocket.html +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_websocket.js +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_win32.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/_win32_raw_display.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/common.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/html_fragment.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/lcd.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/raw.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/web.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/display/websocket.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/__init__.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/abstract_loop.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/glib_loop.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/guarded_loop.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/main_loop.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/select_loop.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/tornado_loop.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/trio_loop.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/twisted_loop.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/event_loop/zmq_loop.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/font.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/graphics.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/numedit.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/py.typed +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/signals.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/split_repr.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/str_util.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/testing.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/text_layout.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/util.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/vterm.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/__init__.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/ansi_text.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/attr_map.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/attr_wrap.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/bar_graph.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/big_text.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/box_adapter.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/columns.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/container.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/deque_walker.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/drop_down.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/edit.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/filler.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/filtered_walker.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/frame.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/grid_flow.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/line_box.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/list_walker.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/listbox.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/monitored_deque.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/monitored_list.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/notifications.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/overlay.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/overlay_stack.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/padding.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/pile.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/popup.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/progress_bar.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/solid_fill.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/table.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/text.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/widget.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid/widget/widget_decoration.py +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid.egg-info/SOURCES.txt +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid.egg-info/dependency_links.txt +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid.egg-info/not-zip-safe +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid.egg-info/requires.txt +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid.egg-info/scm_file_list.json +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/urwid.egg-info/top_level.txt +0 -0
- {urwid-5.1.1 → urwid-5.1.2}/yamllint-requirements.txt +0 -0
|
@@ -477,9 +477,17 @@ class Screen(BaseScreen, RealTerminal):
|
|
|
477
477
|
return processed, raw
|
|
478
478
|
|
|
479
479
|
def _encode_mouse_event(self) -> list[int]:
|
|
480
|
-
|
|
480
|
+
"""Encode the pending curses mouse event as X10 mouse reports.
|
|
481
|
+
|
|
482
|
+
:returns: the codes of the reports, empty when ncurses has no event in its queue.
|
|
483
|
+
"""
|
|
481
484
|
last_state = next_state = self.last_bstate
|
|
482
|
-
|
|
485
|
+
try:
|
|
486
|
+
(_id, x, y, _z, bstate) = curses.getmouse()
|
|
487
|
+
except curses.error:
|
|
488
|
+
# ncurses returns KEY_MOUSE also when its queue holds no event matching the mask,
|
|
489
|
+
# e.g. for every pointer move on the FreeBSD syscons console, and getmouse() then fails.
|
|
490
|
+
return []
|
|
483
491
|
|
|
484
492
|
mod = 0
|
|
485
493
|
if bstate & curses.BUTTON_SHIFT:
|
|
@@ -435,14 +435,16 @@ class KeyqueueTrie:
|
|
|
435
435
|
more_available: bool,
|
|
436
436
|
*,
|
|
437
437
|
csi_u_shift_applied: bool = False,
|
|
438
|
-
) -> tuple[str | _MouseInput | _CursorPosition | _TerminalReport, list[int]] | None:
|
|
438
|
+
) -> tuple[str | _MouseInput | _CursorPosition | _TerminalReport | None, list[int]] | None:
|
|
439
439
|
"""Decode the longest key sequence matching the start of ``keys``, trying the trie then the special reports.
|
|
440
440
|
|
|
441
441
|
:param keys: the codes after the ESC that starts the sequence.
|
|
442
442
|
:param more_available: raise MoreInputRequired when the codes end in the middle of a sequence.
|
|
443
443
|
:param csi_u_shift_applied: see `read_key_report`.
|
|
444
|
+
:returns: the input and the codes left after it, with ``None`` as the input of a mouse report cut short;
|
|
445
|
+
``None`` when no sequence matches.
|
|
444
446
|
"""
|
|
445
|
-
result: tuple[str | _MouseInput | _CursorPosition | _TerminalReport, list[int]] | None
|
|
447
|
+
result: tuple[str | _MouseInput | _CursorPosition | _TerminalReport | None, list[int]] | None
|
|
446
448
|
if result := self.get_recurse(self.data, keys, more_available):
|
|
447
449
|
return result
|
|
448
450
|
|
|
@@ -465,7 +467,7 @@ class KeyqueueTrie:
|
|
|
465
467
|
root: (_KeyQueueData | str),
|
|
466
468
|
keys: list[int],
|
|
467
469
|
more_available: bool,
|
|
468
|
-
) -> tuple[str | _MouseInput, list[int]] | None:
|
|
470
|
+
) -> tuple[str | _MouseInput | None, list[int]] | None:
|
|
469
471
|
"""
|
|
470
472
|
Walk the trie for the next key, consuming codes as it goes.
|
|
471
473
|
|
|
@@ -495,14 +497,32 @@ class KeyqueueTrie:
|
|
|
495
497
|
self,
|
|
496
498
|
keys: list[int],
|
|
497
499
|
more_available: bool,
|
|
498
|
-
) -> tuple[_MouseInput, list[int]] | None:
|
|
500
|
+
) -> tuple[_MouseInput | None, list[int]] | None:
|
|
499
501
|
"""Read an X10 mouse report from the codes and return the resulting input.
|
|
500
502
|
|
|
503
|
+
A report cut short is consumed and gives ``None`` as its input.
|
|
504
|
+
It is cut short when the next ``ESC [ M`` report starts in place of one of its three bytes,
|
|
505
|
+
or when the codes end after one or two of them.
|
|
506
|
+
The FreeBSD ``vt(4)`` console sends such reports, since it leaves out a column or row past 94.
|
|
507
|
+
|
|
508
|
+
:returns: the mouse event, or ``None`` for a report cut short, and the codes left after the report;
|
|
509
|
+
``None`` when the codes end right after ``ESC [ M``.
|
|
501
510
|
:raises MoreInputRequired: the codes end in the middle of a sequence and *more_available* is set.
|
|
502
511
|
"""
|
|
512
|
+
# Any other byte below the offset is a coordinate the terminal wrapped past 255, as the Linux console does;
|
|
513
|
+
# 27 is one too (column or row 250), so only a whole "ESC [ M" marks the next report.
|
|
514
|
+
for i, k in enumerate(keys[:3]):
|
|
515
|
+
if k == 27:
|
|
516
|
+
following = tuple(keys[i + 1 : i + 3])
|
|
517
|
+
if following == _NEXT_MOUSE_REPORT:
|
|
518
|
+
return None, keys[i:]
|
|
519
|
+
if more_available and len(following) < 2 and following == _NEXT_MOUSE_REPORT[: len(following)]:
|
|
520
|
+
raise MoreInputRequired
|
|
503
521
|
if len(keys) < 3:
|
|
504
522
|
if more_available:
|
|
505
523
|
raise MoreInputRequired
|
|
524
|
+
if keys:
|
|
525
|
+
return None, []
|
|
506
526
|
return None
|
|
507
527
|
|
|
508
528
|
b = keys[0] - _MOUSE_BYTE_OFFSET
|
|
@@ -955,6 +975,8 @@ _MOUSE_BYTE_MAX: typing.Final = 255
|
|
|
955
975
|
# the 0-based column or row an X10 report cannot carry: xterm sends it, and any farther one, as a NUL byte,
|
|
956
976
|
# which decodes back to this value
|
|
957
977
|
MOUSE_X10_PAST_END: typing.Final = 255 - _MOUSE_BYTE_OFFSET
|
|
978
|
+
# the codes after ESC that start an X10 report
|
|
979
|
+
_NEXT_MOUSE_REPORT: typing.Final = (ord("["), ord("M"))
|
|
958
980
|
|
|
959
981
|
|
|
960
982
|
#################################################
|
|
@@ -1052,6 +1074,7 @@ def process_keyqueue(
|
|
|
1052
1074
|
rather than the Delete key st sends it for; with xterm's modifyOtherKeys, a CSI u report carries the character
|
|
1053
1075
|
typed with shift.
|
|
1054
1076
|
:returns: a ``(list of input, list of remaining key codes)`` tuple.
|
|
1077
|
+
The list of input is empty when the codes consumed are a mouse report cut short.
|
|
1055
1078
|
:raises MoreInputRequired: the codes end in the middle of a sequence and *more_available* is set.
|
|
1056
1079
|
"""
|
|
1057
1080
|
code = codes[0]
|
|
@@ -1129,7 +1152,7 @@ def process_keyqueue(
|
|
|
1129
1152
|
shift_applied = keyboard_protocol == "modify other keys"
|
|
1130
1153
|
if (result := input_trie.get(codes[1:], more_available, csi_u_shift_applied=shift_applied)) is not None:
|
|
1131
1154
|
decoded, remaining_codes = result
|
|
1132
|
-
return [decoded], remaining_codes
|
|
1155
|
+
return ([] if decoded is None else [decoded]), remaining_codes
|
|
1133
1156
|
|
|
1134
1157
|
# An unrecognised control sequence is one key: decoding it byte by byte would type its body as text.
|
|
1135
1158
|
if codes[1:2] == [ord("[")] and (length := _control_sequence_length(codes[2:], more_available)) is not None:
|
|
@@ -1145,7 +1168,7 @@ def process_keyqueue(
|
|
|
1145
1168
|
run, remaining_codes = process_keyqueue(codes[1:], more_available, keyboard_protocol=keyboard_protocol)
|
|
1146
1169
|
# A mouse event or a terminal report (cursor position, DECRPM, a query reply) cannot take a meta prefix,
|
|
1147
1170
|
# and an unrecognised control sequence may be such a report.
|
|
1148
|
-
if not isinstance(run[0], str) or run[0] == "esc" or "meta " in run[0] or run[0].startswith("<csi "):
|
|
1171
|
+
if not run or not isinstance(run[0], str) or run[0] == "esc" or "meta " in run[0] or run[0].startswith("<csi "):
|
|
1149
1172
|
return ["esc", *run], remaining_codes
|
|
1150
1173
|
return [f"meta {run[0]}", *run[1:]], remaining_codes
|
|
1151
1174
|
|
|
@@ -28,6 +28,7 @@ import functools
|
|
|
28
28
|
import inspect
|
|
29
29
|
import logging
|
|
30
30
|
import typing
|
|
31
|
+
import weakref
|
|
31
32
|
|
|
32
33
|
from .abstract_loop import EventLoop, ExitMainLoop
|
|
33
34
|
|
|
@@ -89,7 +90,7 @@ class AsyncioEventLoop(EventLoop):
|
|
|
89
90
|
self._idle_handle: int = 0
|
|
90
91
|
self._idle_callbacks: dict[int, Callable[[], typing.Any]] = {}
|
|
91
92
|
self._background_tasks: set[asyncio.Task[typing.Any]] = set()
|
|
92
|
-
self._pending_alarms:
|
|
93
|
+
self._pending_alarms: weakref.WeakSet[asyncio.TimerHandle] = weakref.WeakSet()
|
|
93
94
|
|
|
94
95
|
def __del__(self) -> None:
|
|
95
96
|
"""Close the runner created for a loop that was neither given nor running.
|
|
@@ -186,10 +187,13 @@ class AsyncioEventLoop(EventLoop):
|
|
|
186
187
|
call_idle = self._also_call_idle(callback)
|
|
187
188
|
|
|
188
189
|
def fire() -> None:
|
|
189
|
-
|
|
190
|
+
# The loop holds the running handle alive; keep only a weak reference here.
|
|
191
|
+
fired_handle = typing.cast("asyncio.TimerHandle", handle_ref())
|
|
192
|
+
self._pending_alarms.discard(fired_handle)
|
|
190
193
|
call_idle()
|
|
191
194
|
|
|
192
195
|
handle = self._loop.call_later(seconds, fire)
|
|
196
|
+
handle_ref = weakref.ref(handle)
|
|
193
197
|
self._pending_alarms.add(handle)
|
|
194
198
|
return handle
|
|
195
199
|
|
|
@@ -197,14 +201,13 @@ class AsyncioEventLoop(EventLoop):
|
|
|
197
201
|
"""
|
|
198
202
|
Remove an alarm.
|
|
199
203
|
|
|
200
|
-
:returns: True if the alarm was still pending, False if it has fired
|
|
204
|
+
:returns: True if the alarm was still pending, False if it has fired, was removed already,
|
|
205
|
+
or was cancelled directly with handle.cancel().
|
|
201
206
|
"""
|
|
207
|
+
existed = handle in self._pending_alarms and not handle.cancelled()
|
|
208
|
+
self._pending_alarms.discard(handle)
|
|
202
209
|
handle.cancel()
|
|
203
|
-
|
|
204
|
-
self._pending_alarms.remove(handle)
|
|
205
|
-
except KeyError:
|
|
206
|
-
return False
|
|
207
|
-
return True
|
|
210
|
+
return existed
|
|
208
211
|
|
|
209
212
|
def watch_file(self, fd: int, callback: Callable[[], typing.Any]) -> int:
|
|
210
213
|
"""Call callback() when fd has some data to read.
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '5.1.
|
|
22
|
-
__version_tuple__ = version_tuple = (5, 1,
|
|
21
|
+
__version__ = version = '5.1.2'
|
|
22
|
+
__version_tuple__ = version_tuple = (5, 1, 2)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'gf05a5be77'
|
|
@@ -608,6 +608,12 @@ class _BoxSymbolsCollection(typing.NamedTuple):
|
|
|
608
608
|
.. note::
|
|
609
609
|
The default terminal fonts of GNOME, KDE Plasma and Xfce on Ubuntu, Fedora and Arch,
|
|
610
610
|
and of Windows Terminal, show every symbol.
|
|
611
|
+
The default fonts of the Linux virtual console are:
|
|
612
|
+
|
|
613
|
+
- Ubuntu: Fixed 8x16.
|
|
614
|
+
- Fedora and openSUSE: eurlatgr.
|
|
615
|
+
- Arch: the built-in 8x16 font of the kernel.
|
|
616
|
+
|
|
611
617
|
The default fonts of the Linux virtual console and of the classic Windows console show these:
|
|
612
618
|
|
|
613
619
|
=================================== ====== ====== ====== ==== =======
|
|
@@ -651,6 +657,12 @@ class BAR_SYMBOLS(enum.StrEnum):
|
|
|
651
657
|
.. note::
|
|
652
658
|
The default terminal fonts of GNOME, KDE Plasma and Xfce on Ubuntu, Fedora and Arch,
|
|
653
659
|
and of Windows Terminal, show every symbol.
|
|
660
|
+
The default fonts of the Linux virtual console are:
|
|
661
|
+
|
|
662
|
+
- Ubuntu: Fixed 8x16.
|
|
663
|
+
- Fedora and openSUSE: eurlatgr.
|
|
664
|
+
- Arch: the built-in 8x16 font of the kernel.
|
|
665
|
+
|
|
654
666
|
The default fonts of the Linux virtual console and of the classic Windows console show only the full block,
|
|
655
667
|
so the partial blocks need a console font with wider coverage there.
|
|
656
668
|
"""
|
|
@@ -667,6 +679,12 @@ class _SHADE_SYMBOLS(typing.NamedTuple):
|
|
|
667
679
|
.. note::
|
|
668
680
|
The default terminal fonts of GNOME, KDE Plasma and Xfce on Ubuntu, Fedora and Arch,
|
|
669
681
|
and of Windows Terminal, show every symbol.
|
|
682
|
+
The default fonts of the Linux virtual console are:
|
|
683
|
+
|
|
684
|
+
- Ubuntu: Fixed 8x16.
|
|
685
|
+
- Fedora and openSUSE: eurlatgr.
|
|
686
|
+
- Arch: the built-in 8x16 font of the kernel.
|
|
687
|
+
|
|
670
688
|
The default fonts of the Linux virtual console and of the classic Windows console show these:
|
|
671
689
|
|
|
672
690
|
================ ====== ====== ====== ==== =======
|
|
@@ -17,6 +17,12 @@ class DividerSymbols(enum.StrEnum):
|
|
|
17
17
|
.. note::
|
|
18
18
|
The default terminal fonts of GNOME, KDE Plasma and Xfce on Ubuntu, Fedora and Arch,
|
|
19
19
|
and of Windows Terminal, show every member.
|
|
20
|
+
The default fonts of the Linux virtual console are:
|
|
21
|
+
|
|
22
|
+
- Ubuntu: Fixed 8x16.
|
|
23
|
+
- Fedora and openSUSE: eurlatgr.
|
|
24
|
+
- Arch: the built-in 8x16 font of the kernel.
|
|
25
|
+
|
|
20
26
|
The default fonts of the Linux virtual console and of the classic Windows console show these:
|
|
21
27
|
|
|
22
28
|
================== ====== ====== ====== ==== =======
|
|
@@ -101,6 +101,12 @@ class ScrollbarSymbols(enum.StrEnum):
|
|
|
101
101
|
.. note::
|
|
102
102
|
The default terminal fonts of GNOME, KDE Plasma and Xfce on Ubuntu, Fedora and Arch,
|
|
103
103
|
and of Windows Terminal, show every member.
|
|
104
|
+
The default fonts of the Linux virtual console are:
|
|
105
|
+
|
|
106
|
+
- Ubuntu: Fixed 8x16.
|
|
107
|
+
- Fedora and openSUSE: eurlatgr.
|
|
108
|
+
- Arch: the built-in 8x16 font of the kernel.
|
|
109
|
+
|
|
104
110
|
The default fonts of the Linux virtual console and of the classic Windows console
|
|
105
111
|
show these non-ASCII members:
|
|
106
112
|
|
|
@@ -52,6 +52,12 @@ class SpinnerFrames(enum.Enum):
|
|
|
52
52
|
.. note::
|
|
53
53
|
The default terminal fonts of GNOME, KDE Plasma and Xfce on Ubuntu, Fedora and Arch,
|
|
54
54
|
and of Windows Terminal, show every member.
|
|
55
|
+
The default fonts of the Linux virtual console are:
|
|
56
|
+
|
|
57
|
+
- Ubuntu: Fixed 8x16.
|
|
58
|
+
- Fedora and openSUSE: eurlatgr.
|
|
59
|
+
- Arch: the built-in 8x16 font of the kernel.
|
|
60
|
+
|
|
55
61
|
The default fonts of the Linux virtual console and of the classic Windows console
|
|
56
62
|
show none of the non-ASCII members,
|
|
57
63
|
so use :attr:`LINE` or :attr:`DOTS` there unless the console font has wider coverage.
|
|
@@ -70,6 +70,12 @@ class TabsSymbols(enum.StrEnum):
|
|
|
70
70
|
.. note::
|
|
71
71
|
The default terminal fonts of GNOME, KDE Plasma and Xfce on Ubuntu, Fedora and Arch,
|
|
72
72
|
and of Windows Terminal, show every member.
|
|
73
|
+
The default fonts of the Linux virtual console are:
|
|
74
|
+
|
|
75
|
+
- Ubuntu: Fixed 8x16.
|
|
76
|
+
- Fedora and openSUSE: eurlatgr.
|
|
77
|
+
- Arch: the built-in 8x16 font of the kernel.
|
|
78
|
+
|
|
73
79
|
The default fonts of the Linux virtual console and of the classic Windows console
|
|
74
80
|
show these non-ASCII members:
|
|
75
81
|
|
|
@@ -88,6 +88,12 @@ class TreeSymbols(enum.StrEnum):
|
|
|
88
88
|
.. note::
|
|
89
89
|
The default terminal fonts of GNOME, KDE Plasma and Xfce on Ubuntu, Fedora and Arch,
|
|
90
90
|
and of Windows Terminal, show every member.
|
|
91
|
+
The default fonts of the Linux virtual console are:
|
|
92
|
+
|
|
93
|
+
- Ubuntu: Fixed 8x16.
|
|
94
|
+
- Fedora and openSUSE: eurlatgr.
|
|
95
|
+
- Arch: the built-in 8x16 font of the kernel.
|
|
96
|
+
|
|
91
97
|
The default fonts of the Linux virtual console and of the classic Windows console
|
|
92
98
|
show these non-ASCII members:
|
|
93
99
|
|
|
@@ -162,6 +162,12 @@ class CheckBox(WidgetWrap[Columns]):
|
|
|
162
162
|
.. note::
|
|
163
163
|
The default terminal fonts of GNOME, KDE Plasma and Xfce on Ubuntu, Fedora and Arch,
|
|
164
164
|
and of Windows Terminal, show every member.
|
|
165
|
+
The default fonts of the Linux virtual console are:
|
|
166
|
+
|
|
167
|
+
- Ubuntu: Fixed 8x16.
|
|
168
|
+
- Fedora and openSUSE: eurlatgr.
|
|
169
|
+
- Arch: the built-in 8x16 font of the kernel.
|
|
170
|
+
|
|
165
171
|
The default fonts of the Linux virtual console and of the classic Windows console
|
|
166
172
|
show these non-ASCII members:
|
|
167
173
|
|
|
@@ -171,8 +177,11 @@ class CheckBox(WidgetWrap[Columns]):
|
|
|
171
177
|
``CHECK_MARK`` ✓ no yes no no
|
|
172
178
|
``BALLOT_X`` ✗ yes yes no no
|
|
173
179
|
``BULLET`` • yes yes yes yes
|
|
180
|
+
``MIDDLE_DOT`` · yes yes yes yes
|
|
174
181
|
``BLACK_CIRCLE`` ● yes yes no yes
|
|
175
182
|
``WHITE_CIRCLE`` ○ no no yes yes
|
|
183
|
+
``FISHEYE`` ◉ no no no no
|
|
184
|
+
``CIRCLED_SLASH`` ⊘ yes no no no
|
|
176
185
|
``FULL_BLOCK`` █ yes yes yes yes
|
|
177
186
|
``MEDIUM_SHADE`` ▒ yes yes yes yes
|
|
178
187
|
``MINUS_SIGN`` U+2212 yes yes no yes
|
|
@@ -196,8 +205,11 @@ class CheckBox(WidgetWrap[Columns]):
|
|
|
196
205
|
CHECK_MARK = "✓"
|
|
197
206
|
BALLOT_X = "✗"
|
|
198
207
|
BULLET = "•"
|
|
208
|
+
MIDDLE_DOT = "·"
|
|
199
209
|
BLACK_CIRCLE = "●"
|
|
200
210
|
WHITE_CIRCLE = "○"
|
|
211
|
+
FISHEYE = "◉"
|
|
212
|
+
CIRCLED_SLASH = "⊘"
|
|
201
213
|
FULL_BLOCK = "█"
|
|
202
214
|
MEDIUM_SHADE = "▒"
|
|
203
215
|
# Marks that pair with the checked/unchecked ones above for the "mixed" state
|
|
@@ -306,6 +318,13 @@ class CheckBox(WidgetWrap[Columns]):
|
|
|
306
318
|
|
|
307
319
|
Signals supported: ``'change'``, ``"postchange"``
|
|
308
320
|
|
|
321
|
+
- ``"change"`` is sent before the state changes.
|
|
322
|
+
The callback gets the new state.
|
|
323
|
+
:attr:`state` still holds the old one.
|
|
324
|
+
- ``"postchange"`` is sent after the state changes.
|
|
325
|
+
The callback gets the old state.
|
|
326
|
+
:attr:`state` holds the new one.
|
|
327
|
+
|
|
309
328
|
Register signal handler with::
|
|
310
329
|
|
|
311
330
|
urwid.connect_signal(check_box, "change", callback, user_data)
|
|
@@ -634,7 +653,12 @@ class RadioButton(CheckBox):
|
|
|
634
653
|
"first True" will set to True if group is empty.
|
|
635
654
|
A button created with state True clears the other buttons of the group, as :meth:`set_state` does.
|
|
636
655
|
|
|
637
|
-
Signals supported: ``'change'``, ``"postchange"
|
|
656
|
+
Signals supported: ``'change'``, ``"postchange"``, sent as described for :class:`CheckBox`.
|
|
657
|
+
|
|
658
|
+
Selecting a button with :meth:`set_state` sends its own signals first.
|
|
659
|
+
Then the previously selected button of the group is cleared and sends its signals.
|
|
660
|
+
So in the handlers of the newly selected button the previously selected button is still True.
|
|
661
|
+
In the ``"postchange"`` handler of the cleared button, :attr:`selected_button` is the new selection.
|
|
638
662
|
|
|
639
663
|
Register signal handler with::
|
|
640
664
|
|
|
@@ -656,6 +680,18 @@ class RadioButton(CheckBox):
|
|
|
656
680
|
<RadioButton selectable fixed/flow widget 'Disagree' state=False>
|
|
657
681
|
>>> b2.render((15,), focus=True).text # ... = b in Python 3
|
|
658
682
|
[...'( ) Disagree ']
|
|
683
|
+
|
|
684
|
+
Signal order when the selection moves from b1 to b2,
|
|
685
|
+
printed as the button, the signal argument and then the states of b1 and b2:
|
|
686
|
+
|
|
687
|
+
>>> def report(button, state):
|
|
688
|
+
... print(button.label, state, b1.state, b2.state)
|
|
689
|
+
>>> keys = [connect_signal(b, name, report) for b in bgroup for name in ("change", "postchange")]
|
|
690
|
+
>>> b2.set_state(True)
|
|
691
|
+
Disagree True True False
|
|
692
|
+
Disagree False True True
|
|
693
|
+
Agree False True True
|
|
694
|
+
Agree True False True
|
|
659
695
|
"""
|
|
660
696
|
if state == "first True":
|
|
661
697
|
state = not group
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|