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

ScrollBar: fully support __length_hint__ not Sized #863

Merged
merged 2 commits into from Mar 18, 2024

Conversation

penguinolog
Copy link
Collaborator

  • Convert __len__ and __length_hint__ of ListBox to properties: AttributeError will be properly handled by getattr / hasattr
  • Reset to the absolute render way in case of the all contents are expected to be rendered
  • better handling of decorated widgets for scrolling
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)

@penguinolog penguinolog added the Feature Feature request/implementation label Mar 14, 2024
@github-actions github-actions bot added docs Issues related to documentation Tests Tests Widget labels Mar 14, 2024
@@ -344,3 +346,54 @@ def test_large_selectable(self):
widget.keypress(reduced_size, "down")

self.assertEqual(pos_1_down_rendered, widget.render(reduced_size).decoded_text)

def test_hinted_len(self):
class HintedWalker(urwid.ListWalker):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for single test only and not pretend for fully correct work

@penguinolog penguinolog requested a review from wardi March 14, 2024 14:05
@penguinolog penguinolog removed the docs Issues related to documentation label Mar 14, 2024
@penguinolog penguinolog removed the request for review from wardi March 14, 2024 14:07
* Convert `__len__` and `__length_hint__` of `ListBox` to properties:
  `AttributeError` will be properly handled by `getattr` / `hasattr`
* Reset to the absolute render way in case of the all contents are expected to be rendered
* better handling of decorated widgets for scrolling
@penguinolog penguinolog requested a review from wardi March 14, 2024 14:08
@github-actions github-actions bot added the docs Issues related to documentation label Mar 14, 2024
@coveralls
Copy link

coveralls commented Mar 14, 2024

Pull Request Test Coverage Report for Build 8286323264

Details

  • 18 of 20 (90.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 74.645%

Changes Missing Coverage Covered Lines Changed/Added Lines %
urwid/widget/listbox.py 9 10 90.0%
urwid/widget/scrollable.py 9 10 90.0%
Totals Coverage Status
Change from base Build 8267541672: 0.1%
Covered Lines: 9368
Relevant Lines: 12695

💛 - Coveralls

@penguinolog penguinolog merged commit bc7f44b into urwid:master Mar 18, 2024
35 checks passed
@penguinolog penguinolog deleted the scrollbar_estimated_size branch March 18, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Issues related to documentation Feature Feature request/implementation Tests Tests Widget
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants