def convert(_module): if _module.__class__ == Module: return _module.__class__ = Module for _port_spec in _module.db_portSpecs: PortSpec.convert(_port_spec) if _module.db_location: Location.convert(_module.db_location) for _function in _module.db_functions: ModuleFunction.convert(_function) for _annotation in _module.db_get_annotations(): Annotation.convert(_annotation) _module.set_defaults()
def convert(_module): _module.__class__ = Module _module.registry = None for _port_spec in _module.db_portSpecs: PortSpec.convert(_port_spec) _module.add_port_to_registry(_port_spec) if _module.db_location: Location.convert(_module.db_location) for _function in _module.db_functions: ModuleFunction.convert(_function) for _annotation in _module.db_get_annotations(): Annotation.convert(_annotation) _module.portVisible = set()
def convert(_desc): if _desc.__class__ == ModuleDescriptor: return _desc.__class__ = ModuleDescriptor for port_spec in _desc.db_portSpecs: PortSpec.convert(port_spec) # do more init stuff _desc.children = [] _desc.module = None _desc._base_descriptor = None _desc._port_count = 0 _desc.set_defaults()