Skip to content

ScrollBar: fully support __length_hint__ not Sized - #863

Merged
penguinolog merged 2 commits into
urwid:masterfrom
penguinolog:scrollbar_estimated_size
Mar 18, 2024
Merged

penguinolog merged 2 commits into
urwid:masterfrom
penguinolog:scrollbar_estimated_size

Conversation

@penguinolog

Copy link
Copy Markdown
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
Comment thread tests/test_scrollable.py
self.assertEqual(pos_1_down_rendered, widget.render(reduced_size).decoded_text)

def test_hinted_len(self):
class HintedWalker(urwid.ListWalker):

Copy link
Copy Markdown
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 force-pushed the scrollbar_estimated_size branch from 569ca14 to 8c34f9a Compare March 14, 2024 14:08
@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

coveralls commented Mar 14, 2024 •

Copy link
Copy Markdown

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
@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.

2 participants