11import { store } from '../../redux/actiondomainStore'
2- import { recordCommand } from '../../redux/actions/actiondomain' ;
2+ import { recordCommand , dropLastCommand } from '../../redux/actions/actiondomain' ;
33import { execPythonMessageWithoutRecording } from './GeppettoJupyterUtils' ;
44
55
@@ -32,7 +32,6 @@ const registerKernelListeners = () => {
3232 return
3333 }
3434 const { kernel, content } = data ;
35- console . log ( "Kernel" , kernel . id , "execute" , content . code )
3635 record ( kernel . id , content . code ) ;
3736 }
3837
@@ -57,8 +56,6 @@ registerKernelListeners();
5756
5857const record = ( kernelID , command ) => {
5958 store . dispatch ( recordCommand ( kernelID , command ) )
60- const actionStore = store . getState ( ) ;
61- console . log ( "store" , actionStore )
6259}
6360
6461const replayAll = ( kernelID ) => {
@@ -68,8 +65,13 @@ const replayAll = (kernelID) => {
6865 "from netpyne_ui.netpyne_geppetto import netpyne_geppetto" ,
6966 "netpyne_geppetto.deleteModel({})" ,
7067 ...store . getState ( ) [ kernelID ] ] ;
71- commands . pop ( ) // we drop the last command which is probably the faulty one
72- execPythonMessageWithoutRecording ( commands . join ( '\n' ) )
68+ const lastCommand = commands . pop ( ) // we drop the last command which is probably the faulty one
69+ const script = commands . join ( '\n' )
70+ console . log ( "Playing" , script )
71+ console . log ( "Skipping last command" , lastCommand )
72+ execPythonMessageWithoutRecording ( script ) . then ( ( ) => {
73+ store . dispatch ( dropLastCommand ( kernelID ) )
74+ } )
7375}
7476
7577export { record , replayAll }
0 commit comments