diff --git a/biocham_jupyter/kernel/biocham_kernel/kernel.py b/biocham_jupyter/kernel/biocham_kernel/kernel.py index 9f5049de91a57821d48d808052ea5bc5738ec702..19a1b7fd78372e6a0f5feb9fcb1b7e5eb6891c9a 100644 --- a/biocham_jupyter/kernel/biocham_kernel/kernel.py +++ b/biocham_jupyter/kernel/biocham_kernel/kernel.py @@ -207,11 +207,16 @@ class BiochamKernel(IPythonKernel): # pylint: disable=too-many-ancestors with open(bcfile, 'r') as bcinput: lines = bcinput.read().split('.\n') # create a cell after current cell for each dotted command - return 'loading {}'.format(bcfile), [{ + empty_cell = [{ 'source': 'set_next_input', - 'text': line.strip() + '.', + 'text': '', 'replace': False, - } for line in reversed(lines) if line.strip()] + }] + command_cells = [{'source': 'set_next_input', + 'text': line.strip() + '.', + 'replace': False, + } for line in reversed(lines) if line.strip()] + return 'loading {}'.format(bcfile), empty_cell + command_cells except FileNotFoundError: return "File doesn't exists", []