#NEWLINE# def ConvertToPyMoBu( component ) : #NEWLINE# #INDENT# 'Utility to convert a FB class to a PMB class' #NEWLINE# if isinstance ( component , PMBComponent ) : #NEWLINE# #INDENT# return component #NEWLINE# #UNINDENT# componentClasses = component . __class__ . __mro__ #NEWLINE# for fbClass in componentClasses : #NEWLINE# #INDENT# pmbClassName = fbClass . __name__ . replace ( 'FB' , 'PMB' ) #NEWLINE# try : #NEWLINE# #INDENT# pmbClass = eval ( pmbClassName ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# return pmbClass . Convert ( component )