@@ -4,7 +4,7 @@ import { ServiceContainer } from './services/ServiceContainer';
44
55const reconnectString : string = "%connect%"
66const saveString : string = "%save%" ;
7- const bootFileName : string = "boot .py" ;
7+ const bootFileName : string = "/main .py" ;
88const bootSavePrefix : string = `with open('${ bootFileName } ', 'w') as f:\n f.write('''\n` ;
99const bootSaveSuffix : string = "\n''')\n" ;
1010
@@ -81,8 +81,8 @@ export class EmbeddedKernel extends BaseKernel {
8181 await this . serviceContainer . deviceService . connect ( this . outputResponse . bind ( this ) ) ;
8282 }
8383 if ( code . includes ( saveString ) ) {
84- // Burn the code after the save string into the boot .py file
85- this . outputResponse ( " Save command detected, saving code to boot.py..." ) ;
84+ // Burn the code after the save string into the main .py file
85+ this . outputResponse ( ` Save command detected, saving code to ${ bootFileName } ...` ) ;
8686 const codeToSave = code . split ( saveString ) [ 1 ] . trim ( ) ;
8787 if ( ! codeToSave ) {
8888 return {
@@ -93,19 +93,19 @@ export class EmbeddedKernel extends BaseKernel {
9393 traceback : [ 'Please provide code to save after the %save% command' ]
9494 } ;
9595 }
96- // Burn the code by adding it to the boot .py file. Can call executeRequest with the code to save
97- // but append the code to write it to the boot .py file at the start of the code.
96+ // Burn the code by adding it to the main .py file. Can call executeRequest with the code to save
97+ // but append the code to write it to the main .py file at the start of the code.
9898 const bootCode = `# This code is automatically generated by the Embedded Kernel\n${ codeToSave } ` ;
9999 const bootCodeWithSave = `${ bootSavePrefix } ${ bootCode } ${ bootSaveSuffix } ` ;
100100
101- // Execute the command to save the boot .py file
101+ // Execute the command to save the main .py file
102102 if ( ! this . serviceContainer . deviceService . getTransport ( ) ) {
103- console . log ( " [Kernel] executeRequest - No transport available for saving boot.py" ) ;
103+ console . log ( ` [Kernel] executeRequest - No transport available for saving ${ bootFileName } ` ) ;
104104 return {
105105 status : 'error' ,
106106 execution_count : this . executionCount ,
107107 ename : 'TransportError' ,
108- evalue : ' No transport available to save boot.py' ,
108+ evalue : ` No transport available to save ${ bootFileName } ` ,
109109 traceback : [ 'Please connect a device first' ]
110110 } ;
111111 }
@@ -123,7 +123,7 @@ export class EmbeddedKernel extends BaseKernel {
123123 traceback : [ result . error || 'Unknown error' ]
124124 } ;
125125 }
126- console . log ( " [Kernel] executeRequest - Code saved to boot.py successfully" ) ;
126+ console . log ( ` [Kernel] executeRequest - Code saved to ${ bootFileName } successfully` ) ;
127127 return {
128128 status : 'ok' ,
129129 execution_count : this . executionCount ,
0 commit comments