Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble adding trogon TUI to typer app #94

Closed
peterjc opened this issue Nov 3, 2024 · 3 comments · May be fixed by #96
Closed

Trouble adding trogon TUI to typer app #94

peterjc opened this issue Nov 3, 2024 · 3 comments · May be fixed by #96

Comments

@peterjc
Copy link

peterjc commented Nov 3, 2024

I tried the documented approach with init_tui, but couldn't get it to add tui to the command.

However adding this did work (spotted somewhere on the issue tracker, I lost the link though):

@app.command()
def tui(ctx: typer.Context):
    from typer.main import get_group
    from trogon import Trogon
    Trogon(get_group(app), click_context=ctx).run()

Using typer 0.12.5, trogon 0.6.0, Python 3.12, macOS

Perhaps a typer example under examples/ would help?

@daneah
Copy link
Collaborator

daneah commented Nov 16, 2024

Thanks for reporting @peterjc; can you see if #96 helps you resolve this or if you're still having challenges with it?

@peterjc
Copy link
Author

peterjc commented Nov 17, 2024

That did work for me, thank you.

Sadly I don't think I kept my earlier attempts to work out what I was doing wrong in hindsight.

@peterjc peterjc closed this as completed Nov 17, 2024
@daneah
Copy link
Collaborator

daneah commented Nov 17, 2024

@peterjc no worries, glad to hear it's working for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants