Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Implement keypress and mouse_event default handlers #721

Merged
merged 4 commits into from Jan 3, 2024

Conversation

penguinolog
Copy link
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
Copy link
Collaborator Author

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

@coveralls
Copy link

coveralls commented Dec 27, 2023

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
Copy link
Collaborator

wardi commented Dec 27, 2023

should also update docs if subclassing Widget will be required

@penguinolog
Copy link
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
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
Collaborator Author

Validated nomadnet, s-tui and mitmproxy: no failures

urwid/widget/widget.py Outdated Show resolved Hide resolved
urwid/widget/widget.py Outdated Show resolved Hide resolved
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
@penguinolog penguinolog merged commit e085a21 into urwid:master Jan 3, 2024
35 checks passed
@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.

None yet

3 participants