Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a3e1b2ac authored by HEMERY Mathieu's avatar HEMERY Mathieu
Browse files

%load magic add an extra cell after loading

parent 869db549
No related branches found
No related tags found
No related merge requests found
......@@ -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", []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment