def _getMessageStructure(message):
 (main, subtype, attrs) = _getContentType(message)
 if (main is not None):
  main = main.lower()
 if (subtype is not None):
  subtype = subtype.lower()
 if (main == 'multipart'):
  return _MultipartMessageStructure(message, subtype, attrs)
 elif ((main, subtype) == ('message', 'rfc822')):
  return _RFC822MessageStructure(message, main, subtype, attrs)
 elif (main == 'text'):
  return _TextMessageStructure(message, main, subtype, attrs)
 else:
  return _SinglepartMessageStructure(message, main, subtype, attrs)

def _getMessageStructure ( message ) : ( main , subtype , attrs ) = _getContentType ( message ) if ( main is not None ) : main = main . lower ( ) if ( subtype is not None ) : subtype = subtype . lower ( ) if ( main == 'multipart' ) : return _MultipartMessageStructure ( message , subtype , attrs ) elif ( ( main , subtype ) == ( 'message' , 'rfc822' ) ) : return _RFC822MessageStructure ( message , main , subtype , attrs ) elif ( main == 'text' ) : return _TextMessageStructure ( message , main , subtype , attrs ) else : return _SinglepartMessageStructure ( message , main , subtype , attrs )
construct an appropriate type of message structure object for the given message object .