Skip to content

Feature: Implement keypress and mouse_event default handlers - #721

Merged
penguinolog merged 4 commits into
urwid:masterfrom
penguinolog:widget_mouse_keypress
Jan 3, 2024
Merged

Feature: Implement keypress and mouse_event default handlers#721
penguinolog merged 4 commits into
urwid:masterfrom
penguinolog:widget_mouse_keypress

Conversation

@penguinolog

Copy link
Copy Markdown
Collaborator
  • Widget class to have default standard handlers
  • Produce debug log for non-selectable widgets received events
  • Produce WidgetWarning if __init__ of base class not called
  • Produce deprecation warnings if no subclassed Widget
Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)

* `Widget` class to have default standard handlers
* Produce debug log for non-selectable widgets received events
* Produce `WidgetWarning` if `__init__` of base class not called
* Produce deprecation warnings if no subclassed Widget
@penguinolog penguinolog added the Feature Feature request/implementation label Dec 27, 2023
@penguinolog
penguinolog requested review from ulidtko and wardi December 27, 2023 10:53
@penguinolog

Copy link
Copy Markdown
Collaborator Author

This PR should be used instead of #718 : do not break existing code

@coveralls

coveralls commented Dec 27, 2023

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 7388485737

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.1%) to 72.118%

Totals Coverage Status
Change from base Build 7337088868: 1.1%
Covered Lines: 7770
Relevant Lines: 10897

💛 - Coveralls

@wardi

wardi commented Dec 27, 2023

Copy link
Copy Markdown
Collaborator

should also update docs if subclassing Widget will be required

@penguinolog

Copy link
Copy Markdown
Collaborator Author

should also update docs if subclassing Widget will be required

https://github.com/urwid/urwid/blob/master/docs/manual/widgets.rst?plain=1#L656

It is already in documentation for the last 11 years

@penguinolog

Copy link
Copy Markdown
Collaborator Author

Validated pudb: fully compatible. With all enabled warnings:

:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='tst.py' mode='r' encoding='UTF-8'>

(Source is not urwid side)

@penguinolog

Copy link
Copy Markdown
Collaborator Author

Validated nomadnet, s-tui and mitmproxy: no failures

Comment thread urwid/widget/widget.py Outdated
Comment thread urwid/widget/widget.py Outdated
penguinolog and others added 2 commits January 2, 2024 18:07
Co-authored-by: Ian Ward <ian@excess.org>
Co-authored-by: Ian Ward <ian@excess.org>
@penguinolog
penguinolog requested a review from wardi January 2, 2024 17:08
Comment thread urwid/widget/widget_decoration.py
@penguinolog
penguinolog merged commit e085a21 into urwid:master Jan 3, 2024
@penguinolog
penguinolog deleted the widget_mouse_keypress branch January 3, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Feature request/implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants