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

list_commands() not working #107

Open
smith558 opened this issue Jan 6, 2023 · 3 comments
Open

list_commands() not working #107

smith558 opened this issue Jan 6, 2023 · 3 comments

Comments

@smith558
Copy link

smith558 commented Jan 6, 2023

image

The command returns an empty list [].

@jtpio
Copy link
Owner

jtpio commented Jan 8, 2023

Right, this is because the frontend might not be ready since everything is being executed in a single execute request.

Maybe using on_ready can help: https://github.com/jtpio/ipylab/blob/main/examples/commands.ipynb

@smith558
Copy link
Author

smith558 commented Jan 8, 2023

@jtpio Thanks! Will try that.

@artttt
Copy link

artttt commented Jan 24, 2023

@jtpio
I've recently found a way of doing this without needing the callback and waits for the frontend to be ready in a single request.

from ipylab import JupyterFrontEnd
from jupyter_ui_poll import run_ui_poll_loop
app = JupyterFrontEnd()
func = lambda: None if app.commands.list_commands() == [] else app.commands.list_commands()
print (run_ui_poll_loop(func))

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

3 participants