(self, file_desc_proto)
Adds the FileDescriptorProto and its types to this database.

    Args:
      file_desc_proto: The FileDescriptorProto to add.
    Raises:
      DescriptorDatabaseException: if an attempt is made to add a proto
        with the same name but different definition than an exisiting
        proto in the database.
Adds the FileDescriptorProto and its types to this database.
Adds the FileDescriptorProto and its types to this database .
def Add(self, file_desc_proto):
    """Adds the FileDescriptorProto and its types to this database.

    Args:
      file_desc_proto: The FileDescriptorProto to add.
    Raises:
      DescriptorDatabaseException: if an attempt is made to add a proto
        with the same name but different definition than an exisiting
        proto in the database.
    """
    proto_name = file_desc_proto.name
    if proto_name not in self._file_desc_protos_by_file:
      self._file_desc_protos_by_file[proto_name] = file_desc_proto
    elif self._file_desc_protos_by_file[proto_name] != file_desc_proto:
      raise DescriptorDatabaseConflictingDefinitionError(
          '%s already added, but with different descriptor.' % proto_name)

    # Add the top-level Message, Enum and Extension descriptors to the index.
    package = file_desc_proto.package
    for message in file_desc_proto.message_type:
      self._file_desc_protos_by_symbol.update(
          (name, file_desc_proto) for name in _ExtractSymbols(message, package))
    for enum in file_desc_proto.enum_type:
      self._file_desc_protos_by_symbol[
          '.'.join((package, enum.name))] = file_desc_proto
    for extension in file_desc_proto.extension:
      self._file_desc_protos_by_symbol[
          '.'.join((package, extension.name))] = file_desc_proto
def Add ( self , file_desc_proto ) : proto_name = file_desc_proto . name if proto_name not in self . _file_desc_protos_by_file : self . _file_desc_protos_by_file [ proto_name ] = file_desc_proto elif self . _file_desc_protos_by_file [ proto_name ] != file_desc_proto : raise DescriptorDatabaseConflictingDefinitionError ( '%s already added, but with different descriptor.' % proto_name ) # Add the top-level Message, Enum and Extension descriptors to the index. package = file_desc_proto . package for message in file_desc_proto . message_type : self . _file_desc_protos_by_symbol . update ( ( name , file_desc_proto ) for name in _ExtractSymbols ( message , package ) ) for enum in file_desc_proto . enum_type : self . _file_desc_protos_by_symbol [ '.' . join ( ( package , enum . name ) ) ] = file_desc_proto for extension in file_desc_proto . extension : self . _file_desc_protos_by_symbol [ '.' . join ( ( package , extension . name ) ) ] = file_desc_proto