diff --git a/ipsframework/_jupyter/initializer.py b/ipsframework/_jupyter/initializer.py index c91e31a..59a2aeb 100644 --- a/ipsframework/_jupyter/initializer.py +++ b/ipsframework/_jupyter/initializer.py @@ -57,8 +57,8 @@ def _jupyter_notebook_api_code() -> bytes: "cell_type": "markdown", "metadata": {}, "source": [ - "## IPS workstation\n", - "\n", + "## IPS workstation\\n", + "\\n", "You can use this notebook to quickly generate a tarfile with desired runids for download. " ] }, @@ -68,35 +68,35 @@ def _jupyter_notebook_api_code() -> bytes: "metadata": {}, "outputs": [], "source": [ - "from pathlib import Path\n", - "\n", - "import api_v1\n", - "from IPython.display import display\n", - "from ipywidgets import HTML, Button, Layout, Textarea\n", - "\n", - "widget1 = Textarea(\n", - " value='',\n", - " placeholder='Enter runids you want to download, delimited by either spaces or newlines',\n", - " description='Enter runids you want to download, delimited by either spaces or newlines',\n", - " layout=Layout(width='50%', display='flex', flex_flow='column')\n", - ")\n", - "\n", - "widget2 = Button(\n", - " description='Generate tar from input',\n", - " layout=Layout(width='300px')\n", - ")\n", - "\n", - "def generate_tarfile(_button_widget):\n", - " runids = [int(v) for v in widget1.value.split()]\n", - " display(f'Generating tar file from runids: {runids}')\n", - " \n", - " file = Path(api_v1.generate_tar_from_runids(runids))\n", - " display(f'Generated tar file {file.name} in directory {file.parent}, right click the file in the file browser to download it')\n", - "\n", - "widget2.on_click(generate_tarfile)\n", - "\n", - "display(widget1,widget2,HTML(''''''))" ] }