summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Fix incorrect type cast in vterm (`apply_mapping` should return `bytes`) (#545)Alexey Stepanov2023-04-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | * Fix incorrect type cast in vterm (`apply_mapping` should return `bytes`) Add `time.sleep(0.1)` to the event loop tests: in the worst scenario on windows and slow machine function in parallel thread/async can wait up to 80 milliseconds (tested) Add type annotations to the `vterm` and `test_vterm` to simplify error lookup. * Fix `DeprecationWarning` in doctests & examples * Add `pytest` configuration in `pyproject.toml` without migration * `Signals.emit()` rework: stop `user_args` join with `weak_args` Partial: #544 Partial: #512 Partial: #406 * drop `sleep`: not enough effective with pytest * set timer for errors raise to 0: faster raise, faster test done --------- Co-authored-by: Aleksei Stepanov <alekseis@nvidia.com>
* Deprecate legacy property creation (#533)Alexey Stepanov2023-04-122-37/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Python 37+ initial migration (#522)Alexey Stepanov2023-03-3118-193/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Use == instead of "is" for equality testing (#431)naglis2023-03-281-1/+1
| | | | | | | Identity check (`is`, `is not`) with certain literals (e.g. strings, numbers) is not guaranteed by the language specification to work and issue a warning starting with Python 3.8, e.g.: > examples/browse.py:326: SyntaxWarning: "is" with a literal. Did you mean "=="?
* Fix column label typo in tour exampledevfull2021-04-131-1/+1
|
* Fix crash with "ellipsis" clipping for py2akorb2020-08-181-1/+2
| | | | | tour.py works with py2 now Typo in tour.py
* Merge branch 'fix/terminal-unicode-python3'Tony Cebzanov2019-11-051-1/+2
|\
| * added support for input encoding in Terminal widgetTamas Nepusz2019-06-181-1/+2
| |
* | Add demo of ellipsis wrapping mode to tour.py example.Tony Cebzanov2019-10-171-0/+6
| |
* | fix AttributeError on mouse clickmbarkhau2019-08-061-0/+4
|/
* Merge branch 'remove-pollinglistwalker' of https://github.com/hkoof/urwid ↵Tony Cebzanov2019-05-201-3/+3
|\ | | | | | | into hkoof-remove-pollinglistwalker
| * use ListWalker in example script when creating ListBoxesHeiko Noordhof2014-11-061-3/+3
| |
* | Fix suggested socat invocation (raw is deprecated)Eevee (Evelyn Woods)2019-04-261-1/+1
| |
* | Fix use of deprecated asyncio.async()Eevee (Evelyn Woods)2019-04-261-4/+4
| |
* | Fix the asyncio example, and make the raw Screen work without real filesEevee (Lexy Munroe)2019-04-261-3/+14
| | | | | | | | | | I'm not actually sure how this ever worked without trying to call None.fileno() when the Screen was started.
* | 24-bit (true color) support.Tony Cebzanov2018-02-101-8/+185
| | | | | | | | | | | | | | * Palette entires can now use 6-digit #rrggbb hex codes. * These codes are converted to true color escape sequences for terminals that have the proper support. * Documentation updates to follow.
* | Merge pull request #116 from wernight/masterAndrew Dunai2018-01-241-7/+7
|\ \ | | | | | | Change SelectableIcon default cursor_position to 0.
| * | Change SelectableIcon default cursor_position to 0.Werner Beroux2015-03-191-7/+7
| |/ | | | | | | | | Fixes #115. Most users want to have it on the first character, so it should be the default as well.
* | Proper hashbangs by douglas-larocca, closes #137hashbang-envAndrew Dunai2018-01-1718-16/+17
| |
* | Python dual support (#266)Andrew Dunai2018-01-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | python 3 compatibility changesLars Kellogg-Stedman2017-12-248-30/+43
|/ | | | | this updates the syntax in many of the examples so that they run under both python 2 and python 3.
* Add an example that uses asyncio.Eevee (Alex Munroe)2014-06-031-0/+186
|
* Fix some Python 3 things that work fine in 2.6 anyway.Eevee (Alex Munroe)2014-05-112-2/+2
|
* Fix up the Twisted example.Eevee (Alex Munroe)2014-05-111-7/+16
|
* Fix all trailing whitespace.Eevee (Alex Munroe)2014-05-1111-321/+321
|
* fix typos in examplesPaul Ivanov2014-02-216-8/+8
|
* docs: pop_up and subproc examplesIan Ward2014-01-041-1/+4
|
* remove urwid symlinks, use setup.py develop insteadIan Ward2013-12-261-1/+0
|
* allow Screen.set_mouse_tracking(False) to disable mouse trackingJim Garrison2013-03-311-3/+6
|
* merge feature-containersIan Ward2012-03-071-18/+15
|\
| * tour.py: update Padding widgets to use left, right parameters; add max_width ↵Ian Ward2012-01-011-18/+15
| | | | | | | | | | | | | | for GridFlow Padding --HG-- branch : feature-containers
* | tour.py: correct "Weight 6" column labelIan Ward2011-12-281-1/+1
|/
* move docs to docs/ and provide build scriptIan Ward2011-11-291-0/+1
| | | | | | | --HG-- rename : docgen_reference.py => docs/build/docgen_reference.py rename : docgen_tutorial.py => docs/build/docgen_tutorial.py rename : tmpl_tutorial.html => docs/build/tmpl_tutorial.html
* move examples to examples/Ian Ward2011-11-2918-0/+4182
--HG-- rename : bigtext.py => examples/bigtext.py rename : browse.py => examples/browse.py rename : calc.py => examples/calc.py rename : dialog.py => examples/dialog.py rename : edit.py => examples/edit.py rename : fib.py => examples/fib.py rename : graph.py => examples/graph.py rename : input_test.py => examples/input_test.py rename : lcd_cf635.py => examples/lcd_cf635.py rename : palette_test.py => examples/palette_test.py rename : pop_up.py => examples/pop_up.py rename : subproc.py => examples/subproc.py rename : subproc2.py => examples/subproc2.py rename : terminal.py => examples/terminal.py rename : tour.py => examples/tour.py rename : treesample.py => examples/treesample.py rename : twisted_serve_ssh.py => examples/twisted_serve_ssh.py rename : twisted_serve_ssh.tac => examples/twisted_serve_ssh.tac