diff --git a/examples/sessions.ipynb b/examples/sessions.ipynb index 23437dc4..ecd7c5ec 100644 --- a/examples/sessions.ipynb +++ b/examples/sessions.ipynb @@ -30,7 +30,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## show all sessions from the global `SessionManager` instance" + "## Show all sessions from the global `SessionManager` instance" ] }, { @@ -39,7 +39,7 @@ "metadata": {}, "outputs": [], "source": [ - "app.sessions.running()" + "app.sessions.sessions" ] }, { @@ -72,9 +72,7 @@ "metadata": {}, "outputs": [], "source": [ - "app.commands.execute(\n", - " 'console:create', \n", - " app.sessions.current_session)" + "app.commands.execute('console:create', **app.sessions.current_session)" ] }, { @@ -83,42 +81,13 @@ "metadata": {}, "outputs": [], "source": [ - "app.commands.execute(\n", - " 'notebook:create-console', \n", - " {})" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Force update session (asynchronous)\n", - "sessions should be updated automatically, you can force a call to `SessionManager.refreshRunning()`" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import asyncio\n", - "from ipywidgets import Output\n", - "\n", - "out = Output()\n", - "async def refresh_running():\n", - " await app.sessions.refresh_running()\n", - " sesssions = app.sessions.running()\n", - " out.append_stdout('Session Refreshed')\n", - "\n", - "asyncio.create_task(refresh_running())\n", - "out" + "app.commands.execute('notebook:create-console')" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -132,7 +101,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.7" + "version": "3.12.1" } }, "nbformat": 4,