feat(cli): add TUI with trogon

WIP
This commit is contained in:
Jérome Eertmans
2023-08-22 11:41:46 +02:00
parent 3d9522cbb0
commit 1434d97d08
3 changed files with 73 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import json
import click
import requests
from click_default_group import DefaultGroup
from trogon import tui
from .__version__ import __version__
from .convert import convert
@ -11,6 +12,7 @@ from .present import list_scenes, present
from .wizard import init, wizard
@tui()
@click.group(cls=DefaultGroup, default="present", default_if_no_args=True)
@click.option(
"--notify-outdated-version/--silent",
@ -70,5 +72,6 @@ cli.add_command(list_scenes)
cli.add_command(present)
cli.add_command(wizard)
if __name__ == "__main__":
cli()

70
poetry.lock generated
View File

@ -1329,6 +1329,26 @@ files = [
{file = "kiwisolver-1.4.4.tar.gz", hash = "sha256:d41997519fcba4a1e46eb4a2fe31bc12f0ff957b2b81bac28db24744f333e955"},
]
[[package]]
name = "linkify-it-py"
version = "2.0.2"
description = "Links recognition library with FULL unicode support."
optional = false
python-versions = ">=3.7"
files = [
{file = "linkify-it-py-2.0.2.tar.gz", hash = "sha256:19f3060727842c254c808e99d465c80c49d2c7306788140987a1a7a29b0d6ad2"},
{file = "linkify_it_py-2.0.2-py3-none-any.whl", hash = "sha256:a3a24428f6c96f27370d7fe61d2ac0be09017be5190d68d8658233171f1b6541"},
]
[package.dependencies]
uc-micro-py = "*"
[package.extras]
benchmark = ["pytest", "pytest-benchmark"]
dev = ["black", "flake8", "isort", "pre-commit", "pyproject-flake8"]
doc = ["myst-parser", "sphinx", "sphinx-book-theme"]
test = ["coverage", "pytest", "pytest-cov"]
[[package]]
name = "lxml"
version = "4.9.3"
@ -1626,6 +1646,8 @@ files = [
]
[package.dependencies]
linkify-it-py = {version = ">=1,<3", optional = true, markers = "extra == \"linkify\""}
mdit-py-plugins = {version = "*", optional = true, markers = "extra == \"plugins\""}
mdurl = ">=0.1,<1.0"
[package.extras]
@ -3856,6 +3878,23 @@ files = [
[package.dependencies]
mpmath = ">=0.19"
[[package]]
name = "textual"
version = "0.33.0"
description = "Modern Text User Interface framework"
optional = false
python-versions = ">=3.7,<4.0"
files = [
{file = "textual-0.33.0-py3-none-any.whl", hash = "sha256:698a093add0fd21c786232bcacde9ff427a9d5dc9ea5deca93437d9453e4ead1"},
{file = "textual-0.33.0.tar.gz", hash = "sha256:e0a98b1d9c4458c5bb4269c65d0a7f3e926f197411242d2f8faf80183d47a728"},
]
[package.dependencies]
importlib-metadata = ">=4.11.3"
markdown-it-py = {version = ">=2.1.0", extras = ["linkify", "plugins"]}
rich = ">=13.3.3"
typing-extensions = ">=4.4.0,<5.0.0"
[[package]]
name = "tinycss2"
version = "1.2.1"
@ -3940,6 +3979,21 @@ files = [
docs = ["myst-parser", "pydata-sphinx-theme", "sphinx"]
test = ["argcomplete (>=2.0)", "pre-commit", "pytest", "pytest-mock"]
[[package]]
name = "trogon"
version = "0.5.0"
description = "Automatically generate a Textual TUI for your Click CLI"
optional = false
python-versions = ">=3.7,<4.0"
files = [
{file = "trogon-0.5.0-py3-none-any.whl", hash = "sha256:987d2195c1dd2f93c50e555063a9de57edbc5906ce20ee39081343ff194952c1"},
{file = "trogon-0.5.0.tar.gz", hash = "sha256:61a57f0f1a38227d90601cd020f46960be8e36947b5e56c6932c2e01ecc5042a"},
]
[package.dependencies]
click = ">=8.0.0"
textual = ">=0.26.0"
[[package]]
name = "typing-extensions"
version = "4.7.1"
@ -3951,6 +4005,20 @@ files = [
{file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"},
]
[[package]]
name = "uc-micro-py"
version = "1.0.2"
description = "Micro subset of unicode data files for linkify-it-py projects."
optional = false
python-versions = ">=3.7"
files = [
{file = "uc-micro-py-1.0.2.tar.gz", hash = "sha256:30ae2ac9c49f39ac6dce743bd187fcd2b574b16ca095fa74cd9396795c954c54"},
{file = "uc_micro_py-1.0.2-py3-none-any.whl", hash = "sha256:8c9110c309db9d9e87302e2f4ad2c3152770930d88ab385cd544e7a7e75f3de0"},
]
[package.extras]
test = ["coverage", "pytest", "pytest-cov"]
[[package]]
name = "urllib3"
version = "2.0.4"
@ -4106,4 +4174,4 @@ sphinx-directive = ["docutils", "jinja2", "manim"]
[metadata]
lock-version = "2.0"
python-versions = ">=3.8.1,<3.12"
content-hash = "d538c1ad639ba47b69a6a233553c09d371599310bf04f3772c035f58182cbeba"
content-hash = "878eb9dad0be1f88af4fb1bf61e77e05b667a14532eebb51b499fdc2ef408540"

View File

@ -66,6 +66,7 @@ requests = "^2.28.1"
rich = "^13.3.2"
rtoml = "^0.9.0"
tqdm = "^4.64.1"
trogon = "^0.5.0"
[tool.poetry.extras]
magic = ["manim", "ipython"]