File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -458,7 +458,8 @@ export const pythonFromBlock = function (
458458 xfix2 = xfix1 ;
459459 }
460460 if ( block . mrcPythonMethodName == '__init__' ) {
461- branch = generator . INDENT + 'super().__init__()\n' +
461+ let class_specific = generator . getClassSpecificForInit ( ) ;
462+ branch = generator . INDENT + 'super().__init__(' + class_specific + ')\n' +
462463 generator . defineClassVariables ( ) + branch ;
463464 }
464465 if ( returnValue ) {
Original file line number Diff line number Diff line change @@ -291,9 +291,12 @@ export class ExtendedPythonGenerator extends PythonGenerator {
291291 setOpModeDetails ( details : OpModeDetails ) {
292292 this . details = details ;
293293 }
294-
295- getOpModeDetails ( ) : OpModeDetails | null {
296- return this . details ;
294+ getClassSpecificForInit ( ) : string {
295+ let classParent = this . context ?. getClassParent ( ) ;
296+ if ( classParent == 'OpMode' ) {
297+ return 'robot'
298+ }
299+ return ''
297300 }
298301}
299302
You can’t perform that action at this time.
0 commit comments