From 54dd806c26a562fc0d2c4ae5873a23be22fd8c28 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Wed, 9 Jun 2021 14:24:01 +0200 Subject: [PATCH] Apply suggestions from code review include file ext with a name, allow spaces in input datasets and notebook names Co-authored-by: Marius van den Beek --- tools/interactive/interactivetool_jupyter_notebook.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/interactive/interactivetool_jupyter_notebook.xml b/tools/interactive/interactivetool_jupyter_notebook.xml index c7453f06f0d..6a9873b54b0 100644 --- a/tools/interactive/interactivetool_jupyter_notebook.xml +++ b/tools/interactive/interactivetool_jupyter_notebook.xml @@ -25,13 +25,13 @@ #set $cleaned_names = [] #for $file in $input - #set $cleaned_name = re.sub('[^\w\-\.]', '_', str($file.element_identifier)) + #set $cleaned_name = re.sub('[^\w\-\.\s]', '_', str($file.element_identifier)) ## prevent overwriting data with a randomized suffix #if $cleaned_name in $cleaned_names: #set $cleaned_name = $cleaned_name + '_' + ''.join(random.choice(string.ascii_lowercase) for _ in range(3)) #end if #set $cleaned_names += [$cleaned_name] - ln -sf '$file' './jupyter/data/${cleaned_name}' && + ln -sf '$file' './jupyter/data/${cleaned_name}.${file.ext}' && #end for ## change into the directory where the notebooks are located @@ -46,7 +46,7 @@ jupyter lab --allow-root --no-browser --NotebookApp.shutdown_button=True && cp ./ipython_galaxy_notebook.ipynb '$jupyter_notebook' #else: - #set $noteboook_name = re.sub('[^\w\-\.]', '_', str($mode.ipynb.element_identifier)) + #set $noteboook_name = re.sub('[^\w\-\.\s]', '_', str($mode.ipynb.element_identifier)) cp '$mode.ipynb' ./${noteboook_name}.ipynb && jupyter trust ./${noteboook_name}.ipynb && #if $mode.run_it: