summaryrefslogtreecommitdiff
path: root/urwid/container.py
Commit message (Collapse)AuthorAgeFilesLines
* Return original code to the deprecated getters and setters (#549)Alexey Stepanov2023-05-011-17/+213
| | | | | | | | | | | | | | | | | * Return original code to the deprecated getters and setters * Make more aggressive deprecation warning Fix: #548 * Return original code to the deprecated getters and setters * Make more aggressive deprecation warning Fix: #548 --------- Co-authored-by: Aleksei Stepanov <alekseis@nvidia.com>
* Fix regression: `Pile()` focus_item can be Widget -> need to set property ↵Alexey Stepanov2023-04-121-1/+1
| | | | | `focus` in constructor (#535) Co-authored-by: Aleksei Stepanov <alekseis@nvidia.com>
* Deprecate legacy property creation (#533)Alexey Stepanov2023-04-121-255/+671
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Deprecate legacy property creation * Drop long time ago removed methods (never returning methods) * Move large part of property implementations under `@property` * Emit `PendingDeprecationWarning` for old compatibility code for public methods used as core for property and methods for compatibility * Emit `DeprecationWarning` for private methods used in property construction using `property()` call Due to amount of copy-paste like changes, for containers shared part is moved to the existing base classes Add `__len__` to the list based containers. Related #445 Fix typo in type annotation for `Frame.mouse_event` * Update urwid/canvas.py Co-authored-by: Ian Ward <ian@excess.org> * Update urwid/canvas.py Co-authored-by: Ian Ward <ian@excess.org> * Update urwid/tests/test_container.py Co-authored-by: Ian Ward <ian@excess.org> * Fix typo in test name * Frame `header`, `body` and `footer` also has property and methods from pre-property era Make consistent with other containers --------- Co-authored-by: Aleksei Stepanov <alekseis@nvidia.com> Co-authored-by: Ian Ward <ian@excess.org>
* Add extra type annotations (#532)Alexey Stepanov2023-04-061-34/+52
| | | | | | | | | | | | * add basic mypy config for better tracking (now crazy amount of warnings without `strict`) * Useless check in `raw_display` (`if not Popen` will be always `False`) * use explicit `return None` Partial: #406 Related: #512 Related: #408 Co-authored-by: Aleksei Stepanov <alekseis@nvidia.com>
* Annotate types in simple cases and use isinstance (& protocol) based type ↵Alexey Stepanov2023-04-041-164/+256
| | | | | | | | | | | checking (#529) * Use `super()` where possible instead of direct base class Related #525 Partial #406 Fix #510 Co-authored-by: Aleksei Stepanov <alekseis@nvidia.com>
* Python 37+ initial migration (#522)Alexey Stepanov2023-03-311-62/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial migration to the python 3.7: Semi-automatic changes CI related: Update `tox.ini` and `.travis.yml` to run python3 only tests Python 3.11 tests is commented-out on travis until #517 is not merged Manual changes: * `setup.py`: classifiers, remove python2 compatibility code * `docs/manual/wcur2.py`: looks like file was never completed, syntax is invalid * `urwid.compat`: removed `ord2`, `bytes3`, `text_type`, `xrange` and `text_types` Automatic changes (no manual editing, AST validated equality: * removed `u` prefix from all strings: not allowed in modern python code * `bytes()` -> `b''` * `== None` -> `is None` * subclassing of `object` * `super(<Class>`, self>)` ->`super()` * `from __future__ import ...` python3 compatibility imports * `set(<Iterable[Hashable]>)` -> `{<Hashable>}` * partial f-strings conversion * (`IOError`, `select.error`, `socket.error`) -> `OSError` * Switch to f-strings (automatic changes) * Remove `urwid.compat.B` * Remove `urwid.compat.with_metaclass` * use native `super()` instead of `self.__super` * Remove `urwid.compat.chr2` * Remove `urwid.split_repr.python3_repr` * Use native `@classmethod` and `@property` where overload is not possible * Add `from __future__ import annotations` * automatically sort imports * Add DeprecationWarning to the deprecated methods most IDE's will recognize it and annotate during new code usage call with "warnings as errors" mode will help to refactor other users * Address comments * replace homepage address in all files * remove outdated comments in compat.py * make wcur2.py correct python code. For example subclass * replace `self.__super` by `super()` in examples * fix asyncio_socket_server.py: magic with `asyncio` became wrong * Remove `widget.update_wrapper`: this was backport of python `functools.update_wrapper` * display_common.py: fix trivial typo in _colors calculation * use `sorted` method instead of list construction with later sorting * Address comments * `wcur2` include in docs * warning on `signals.Signals.emit` --------- Co-authored-by: Aleksei Stepanov <alekseis@nvidia.com>
* container: fix duplicate text (#490)Mike Frysinger2023-03-281-5/+5
|
* Remove invalid escape sequenceAndrey Lebedev2020-04-171-1/+1
| | | | | | | | This sequence generates DeprecationWarning under Python-3.7: ``` urwid/container.py:150: DeprecationWarning: invalid escape sequence \: """ ```
* Make options a static method where applicablePhilip Matura2020-03-021-3/+6
|
* Fix GridFlow keypress handling when v_sep is 0Aurelien Grenotton2019-12-161-0/+3
| | | | | | | Ensure inner GridFlow's Pile selectable attribute is updated with the added content, so that keypress events are forwarded properly. Fixes https://github.com/urwid/urwid/issues/387
* Fix Frame mouse_event when footer is trimmedPhilip Matura2019-11-051-1/+1
|
* Implement get_cursor_coords for Frame widgetPhilip Matura2019-11-051-0/+27
|
* Merge branch 'minor-fixes'Tony Cebzanov2019-11-041-3/+1
|\
| * Remove dead codePhilip Matura2019-10-091-2/+0
| |
| * Fix .pack call in Columns.column_widthsPhilip Matura2019-10-091-1/+1
| |
* | Make Columns and Pile selectable when any child widget isPhilip Matura2019-10-091-21/+29
|/ | | | | Fixes behaviour when changing contents to non selectable widgets. Before this may have trapped the focus to a non-selectable widget.
* Merge pull request #121 from uSpike/patch-1Andrew Dunai2018-01-171-1/+0
|\ | | | | remove duplicate Columns.dividechars declaration
| * remove duplicate Columns.dividecharsspikergit12015-04-131-1/+0
| | | | | | Seems to be a typo
* | Python dual support (#266)Andrew Dunai2018-01-041-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP * Metaclasses * String literal fixes * Remove 2to3 and make tests compatible with both Python 2 & 3 * Removed debug code. * Added tests for ProgressBar * Fixed examples. * future division & font literals fix * Cleaner fonts initialization.
* | Merge pull request #220 from jwilk-forks/masterAndrew Dunai2018-01-021-1/+1
|\ \ | | | | | | Fix typos
| * | Fix typosJakub Wilk2017-02-281-1/+1
| | |
* | | fixed docstring typomobyte02017-07-261-1/+1
|/ /
* | fix iterator in WidgetContainerListContentsMixinMarlox2016-08-151-2/+2
|/ | | | | (x)range is an iterable __iterator__ should return an iterator (iter(iterable))
* Fix GridFlow focus issueJames E. Blair2014-08-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | The GridFlow widget create a Pile which contains Columns, one per row of the grid. Because it creates the Columns widgets empty, the Columns widgets all have their focus_position set to the default of 0. The only time the GridFlow widget will update the focus of the Columns widgets when constructing them is if the widget it is adding is the focus widget of the GridFlow. This means that if a GridFlow ends up with a row whose first widget is not selectable and the current GridFlow focus position is not in that row, then the entire Columns widget for that row will be considered not selectable (as its focus position will remain 0). Correct this by ensuring that the first selectable widget gets the focus when a GridFlow creats a Columns widget (or the actual GridFlow focus widget if it is in the row). A similar fix is not needed for the Pile focus because as long as the GridFlow focus position is set, the Pile focus will be as well. Fixes issue #61.
* Fix some Python 3 things that work fine in 2.6 anyway.Eevee (Alex Munroe)2014-05-111-10/+10
|
* Fix all trailing whitespace.Eevee (Alex Munroe)2014-05-111-1/+1
|
* fix lots of small typosPaul Ivanov2014-02-211-3/+3
|
* fix #45 GridFlow argument v_sep not working as documentedIan Ward2014-01-041-0/+4
|
* fix for packed columns not resizing when content changes #49Ian Ward2014-01-021-1/+2
|
* fix for #39 Pile.mouse_event error on empty pileIan Ward2013-12-241-0/+2
|
* fix+test for zero-weighted items in PileIan Ward2013-12-241-1/+3
|
* second fix for Columns.move_cursor_to_coordsIan Ward2013-01-271-1/+1
| | | | | --HG-- extra : transplant_source : %FB%12%87%29d%C0%F8%7D/%C2%1C%05T%DCW%84MjEr
* fix for Columns.move_cursor_to_coords not handling left/rightIan Ward2013-01-271-5/+3
|
* add get_focus_widgets container methodMatthijs Kooijman2012-12-131-0/+17
| | | | | | --- urwid/container.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
* fix: Pile not changing focus with mouse since container changesIan Ward2012-11-141-1/+1
|
* fix: Overlay.get_cursor_coords has never workedIan Ward2012-11-021-1/+1
| | | | | --HG-- extra : transplant_source : %E0%1C%B7H%87d%F9%19NR%B2%86%B3w%EE%A7%1D%9E%9B%FB
* fix Columns.get_cursor_coords, move_cursor_to_coords, mouse_event, ↵Ian Ward2012-10-201-10/+23
| | | | get_pref_col focused box column case
* fix Columns.keypress focused box column caseIan Ward2012-10-201-2/+5
|
* fix for columns rows() and get_cursor_coords() regressionsIan Ward2012-10-171-5/+3
|
* reference: improve container docstringsIan Ward2012-10-161-15/+22
|
* manual, tutorial: minor updates/fixesIan Ward2012-10-141-1/+1
|
* fix Pile/Columns descriptionsIan Ward2012-10-141-2/+2
|
* clean up some docstringsIan Ward2012-10-111-62/+48
|
* add missing Overlay.options methodIan Ward2012-10-111-29/+38
|
* Pile, Overlay, Columns fixes for more widget-squishing testsIan Ward2012-09-211-6/+12
| | | | | --HG-- branch : feature-sphinx
* columns: allow cursor right to hidden columnsIan Ward2012-09-211-1/+1
| | | | | --HG-- branch : feature-sphinx
* columns: keep column in focus visibleIan Ward2012-09-211-4/+12
| | | | | --HG-- branch : feature-sphinx
* fix sphinx warningsIan Ward2012-07-141-1/+3
| | | | | --HG-- branch : feature-sphinx
* fixes from default branchIan Ward2012-07-141-3/+3
|\ | | | | | | | | --HG-- branch : feature-sphinx
| * fix Overlay top and bottom paddingMatthijs Kooijman2012-06-271-2/+2
| | | | | | | | | | | | | | | | Due to a copy-paste error, the Overlay widget would apply the left and right padding to the top and bottom as well as to the left and right. --- urwid/container.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)