@@ -26,13 +26,11 @@ import { MRC_STYLE_COMPONENTS } from '../themes/styles'
2626import { createFieldNonEditableText } from '../fields/FieldNonEditableText' ;
2727import { Editor } from '../editor/editor' ;
2828import { ExtendedPythonGenerator } from '../editor/extended_python_generator' ;
29- import { getAllowedTypesForSetCheck , getClassData , getModuleData , getSubclassNames } from './utils/python' ;
29+ import { getAllowedTypesForSetCheck , getClassData , getSubclassNames } from './utils/python' ;
3030import * as toolboxItems from '../toolbox/items' ;
3131import * as storageModule from '../storage/module' ;
3232import * as storageModuleContent from '../storage/module_content' ;
33- import * as storageNames from '../storage/names' ;
3433import { createPort } from './mrc_port' ;
35- import { createNumberShadowValue } from './utils/value' ;
3634import { ClassData , FunctionData } from './utils/python_json_types' ;
3735import { renameMethodCallers } from './mrc_call_python_function'
3836
@@ -166,11 +164,11 @@ const COMPONENT = {
166164 ports : ports ,
167165 } ;
168166 } ,
169- getArgName : function ( this : ComponentBlock , i : number ) : string {
167+ getArgName : function ( this : ComponentBlock , _ : number ) : string {
170168 return this . getFieldValue ( FIELD_NAME ) + '__' + 'port' ;
171169 } ,
172170
173-
171+
174172 getComponentPorts : function ( this : ComponentBlock , ports : { [ argName : string ] : string } ) : void {
175173 // Collect the ports for this component block.
176174 for ( let i = 0 ; i < this . mrcArgs . length ; i ++ ) {
@@ -263,23 +261,4 @@ function createComponentBlock(
263261 }
264262 }
265263 return new toolboxItems . Block ( BLOCK_NAME , extraState , fields , Object . keys ( inputs ) . length ? inputs : null ) ;
266- }
267-
268- function getPortTypeForArgument ( argName : string ) : string | null {
269- const argNameLower = argName . toLowerCase ( ) ;
270- const moduleData = getModuleData ( 'component' ) ;
271- if ( moduleData ) {
272- for ( const enumData of moduleData . enums ) {
273- if ( enumData . enumClassName === 'component.PortType' ) {
274- for ( const value of enumData . enumValues ) {
275- if ( argNameLower === value . toLowerCase ( ) ) {
276- return value ;
277- }
278- }
279- break ;
280- }
281- }
282- }
283-
284- return null ;
285- }
264+ }
0 commit comments