https://github.com/mdbetancourt/tebless
This library is a collection of elements that supported from blessed
https://github.com/mdbetancourt/tebless
blessed cli-interface curses library pip python widgets
Last synced: 2 months ago
JSON representation
This library is a collection of elements that supported from blessed
- Host: GitHub
- URL: https://github.com/mdbetancourt/tebless
- Owner: mdbetancourt
- License: mit
- Created: 2017-09-13T23:53:36.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T20:29:14.000Z (over 2 years ago)
- Last Synced: 2025-04-10T21:11:40.936Z (2 months ago)
- Topics: blessed, cli-interface, curses, library, pip, python, widgets
- Language: Python
- Size: 86.9 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
=======
Tebless
=======.. image:: https://img.shields.io/pypi/v/tebless.svg
:target: https://pypi.python.org/pypi/tebless.. image:: https://img.shields.io/travis/akhail/tebless.svg
:target: https://travis-ci.org/akhail/tebless.. image:: https://readthedocs.org/projects/tebless/badge/?version=latest
:target: http://tebless.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status.. image:: https://pyup.io/repos/github/Akhail/Tebless/shield.svg
:target: https://pyup.io/repos/github/Akhail/Tebless/
:alt: UpdatesThis library is a collection of widgets that supported from blessed allows to create interfaces in a simple way based on events.
* Free software: MIT license
* Documentation: https://tebless.readthedocs.io.Table of contents
------------------ `Tebless`_
- `Table of contents`_
- `How to install`_
- `Example of usage`_How to install
--------------.. code:: bash
pip install tebless
Example of usage
----------------This will render a label containing the text ‘Hello world!’, centered
horizontally and vertically... code:: python
from tebless.widgets import Label, Window, Input
@Window.decorator(main=True, min_y=10)
def view(window):
WIDTH, HEIGHT = window.size
def callback(evt):
evt.store.label.value = evt.valuewindow += Label(
cordy=HEIGHT / 2 - 1,
text='Hello world!',
width=WIDTH,
align='center',
ref='label'
)
window += Input(
width=WIDTH,
cordx=WIDTH / 3,
on_enter=callback
)so easy is placed a text in the console that changes with the input and
limit min height window you can also avoid access to the store.. code:: python
from tebless.widgets import Label, Window, Input
@Window.decorator(min_y=10)
def view(window):
WIDTH, HEIGHT = window.sizelabel = Label(
cordy=HEIGHT / 2 - 1,
text='Hello world!',
width=WIDTH,
align='center'
)def callback(evt):
label.value = evt.valuewindow += label
window += Input(
width=WIDTH,
cordx=WIDTH / 3,
on_enter=callback
)
if __name__ == "__main__":
view()Credits
---------This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
.. _Tebless: #tebless
.. _Table of contents: #table-of-contents
.. _How to install: #how-to-install
.. _Example of usage: #example-of-usage