@@ -4,7 +4,7 @@ import { ServiceContainer } from './services/ServiceContainer';
4
4
5
5
const reconnectString : string = "%connect%"
6
6
const saveString : string = "%save%" ;
7
- const bootFileName : string = "boot .py" ;
7
+ const bootFileName : string = "/main .py" ;
8
8
const bootSavePrefix : string = `with open('${ bootFileName } ', 'w') as f:\n f.write('''\n` ;
9
9
const bootSaveSuffix : string = "\n''')\n" ;
10
10
@@ -81,8 +81,8 @@ export class EmbeddedKernel extends BaseKernel {
81
81
await this . serviceContainer . deviceService . connect ( this . outputResponse . bind ( this ) ) ;
82
82
}
83
83
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 } ...` ) ;
86
86
const codeToSave = code . split ( saveString ) [ 1 ] . trim ( ) ;
87
87
if ( ! codeToSave ) {
88
88
return {
@@ -93,19 +93,19 @@ export class EmbeddedKernel extends BaseKernel {
93
93
traceback : [ 'Please provide code to save after the %save% command' ]
94
94
} ;
95
95
}
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.
98
98
const bootCode = `# This code is automatically generated by the Embedded Kernel\n${ codeToSave } ` ;
99
99
const bootCodeWithSave = `${ bootSavePrefix } ${ bootCode } ${ bootSaveSuffix } ` ;
100
100
101
- // Execute the command to save the boot .py file
101
+ // Execute the command to save the main .py file
102
102
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 } ` ) ;
104
104
return {
105
105
status : 'error' ,
106
106
execution_count : this . executionCount ,
107
107
ename : 'TransportError' ,
108
- evalue : ' No transport available to save boot.py' ,
108
+ evalue : ` No transport available to save ${ bootFileName } ` ,
109
109
traceback : [ 'Please connect a device first' ]
110
110
} ;
111
111
}
@@ -123,7 +123,7 @@ export class EmbeddedKernel extends BaseKernel {
123
123
traceback : [ result . error || 'Unknown error' ]
124
124
} ;
125
125
}
126
- console . log ( " [Kernel] executeRequest - Code saved to boot.py successfully" ) ;
126
+ console . log ( ` [Kernel] executeRequest - Code saved to ${ bootFileName } successfully` ) ;
127
127
return {
128
128
status : 'ok' ,
129
129
execution_count : this . executionCount ,
0 commit comments