jtpio / ipylab

Control JupyterLab from Python Notebooks with Jupyter Widgets 🧪 ☢️ 🐍
BSD 3-Clause "New" or "Revised" License
199 stars 13 forks source link

app.commands.execute("notebook:run-all-below") does not work if cell collapsed #112

Open pixelrakete opened 1 year ago

pixelrakete commented 1 year ago

If I use this code and have the cell collapsed, it doesn't work. Only if the cell code is visible.

import asyncio
app = JupyterFrontEnd()
out = Output()

async def init():
    await app.ready()
    app.commands.execute("notebook:move-cursor-down")
    app.commands.execute("notebook:run-all-below")
    out.append_stdout(cmds)

def on_button_clicked(b):
    global channel_name
    channel_name = cn.value
    cn.close()
    button.close()    
    asyncio.create_task(init())
    out

# start check
button.on_click(on_button_clicked)