#NEWLINE# def __create_message( self , message_type ) : #NEWLINE# #INDENT# '\n        Creates a message that contains info about the message_type.\n        ' #NEWLINE# ( message , message . fields ) = ( self . __self_type ( ) , list ( ) ) #NEWLINE# for field in iter ( message_type ) : #NEWLINE# #INDENT# field_meta = self . __field_metadata_type ( ) #NEWLINE# ( field_meta . tag , field_meta . name , field_type , field_meta . flags ) = field #NEWLINE# field_meta . type = type_str = field_type . __class__ . __name__ #NEWLINE# if isinstance ( field_type , EmbeddedMessage ) : #NEWLINE# #INDENT# field_meta . flags |= Flags . EMBEDDED #NEWLINE# field_meta . embedded_metadata = self . __create_message ( field . message_type ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not type_str . endswith ( 'Type' ) ) : #NEWLINE# #INDENT# raise TypeError ( ( "Type name of type singleton object should end with 'Type'. Actual: '%s'." % type_str ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# field_meta . type = type_str [ : ( - 4 ) ] #NEWLINE# #UNINDENT# #UNINDENT# message . fields . append ( field_meta ) #NEWLINE# #UNINDENT# return message