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

trogon with standalone_mode of click is not working #65

Open
thisismygitrepo opened this issue Oct 21, 2023 · 0 comments
Open

trogon with standalone_mode of click is not working #65

thisismygitrepo opened this issue Oct 21, 2023 · 0 comments

Comments

@thisismygitrepo
Copy link

thisismygitrepo commented Oct 21, 2023

import click
from trogon import tui
from typing import Any


@tui()
@click.command()
@click.option('--description', prompt="Description of the job: ", default=f"Description of running func on remotes", help="Write something that describes what this job is about.")
@click.option('--update_repo', prompt="Update repo: ", default=False, help="Update the repo on the remote machine.")
@click.pass_context
def get_choices(ctx: Any, description: str, update_repo: bool):
    return ctx


if __name__ == '__main__':
    res = get_choices(standalone_mode=False)
    print(res)

This is producing this error:

$ python C:\Users\aalsaf01\code\crocodile\myresources\crocodile\cluster\template_tui2.py tui
Running template_tui2.py get-choices
Traceback (most recent call last):
  File "C:\Users\aalsaf01\code\crocodile\myresources\crocodile\cluster\template_tui2.py", line 20, in <module>
    res = get_choices(standalone_mode=False)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aalsaf01\venvs\ve\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aalsaf01\venvs\ve\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\aalsaf01\venvs\ve\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aalsaf01\venvs\ve\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aalsaf01\venvs\ve\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aalsaf01\venvs\ve\Lib\site-packages\click\decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\aalsaf01\venvs\ve\Lib\site-packages\trogon\trogon.py", line 296, in wrapped_tui
    Trogon(app, app_name=name, command_name=command, click_context=ctx).run()
  File "C:\Users\aalsaf01\venvs\ve\Lib\site-packages\trogon\trogon.py", line 264, in run
    os.execvp(program_name, arguments)
  File "<frozen os>", line 574, in execvp
  File "<frozen os>", line 616, in _execvpe
  File "<frozen os>", line 607, in _execvpe
FileNotFoundError: [Errno 2] No such file or directory
@daneah daneah mentioned this issue Sep 20, 2024
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

No branches or pull requests

1 participant