Skip to content

Commit e1c7b24

Browse files
committed
extra code gets added just when using blocks from the niryo toolbox
1 parent 016b073 commit e1c7b24

File tree

2 files changed

+174
-164
lines changed

2 files changed

+174
-164
lines changed

src/layout.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ export class BlocklyLayout extends PanelLayout {
105105
run(): void {
106106
// Serializing our workspace into the chosen language generator.
107107
let code = this._manager.generator.workspaceToCode(this._workspace);
108-
code =
109-
'from pyniryo import *\nn = NiryoRobot("127.0.0.1")\n' +
110-
code +
111-
'n.close_connection()';
108+
if (this._manager.getToolbox() === 'niryo') {
109+
code =
110+
'from pyniryo import *\nn = NiryoRobot("127.0.0.1")\n' +
111+
code +
112+
'n.close_connection()';
113+
}
112114
this._cell.model.sharedModel.setSource(code);
113115
this.addWidget(this._cell);
114116
this._resizeWorkspace();

0 commit comments

Comments
 (0)