<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
†Üäh,  ã               @   sD   d Z dZG dd„ deƒZG dd„ deƒZG dd„ deƒZdd	„ Zd
S )z*Provides a container for DescriptorProtos.z"matthewtoia@google.com (Matt Toia)c               @   s   e Zd ZdS )ÚErrorN)Ú__name__Ú
__module__Ú__qualname__© r   r   ú)/usr/lib/python3.6/descriptor_database.pyr   $   s   r   c               @   s   e Zd ZdZdS )Ú,DescriptorDatabaseConflictingDefinitionErrorzGRaised when a proto is added with the same name & different descriptor.N)r   r   r   Ú__doc__r   r   r   r   r   (   s   r   c               @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )ÚDescriptorDatabasezEA container accepting FileDescriptorProtos and maps DescriptorProtos.c             C   s   i | _ i | _d S )N)Ú_file_desc_protos_by_fileÚ_file_desc_protos_by_symbol)Úselfr   r   r   Ú__init__/   s    zDescriptorDatabase.__init__c                sâ   ˆ j }|| jkrˆ | j|< n| j| ˆ kr6td| ƒ‚ˆ j}x.ˆ jD ]$}| jj‡ fdd„t||ƒD ƒƒ qDW x$ˆ jD ]}ˆ | jdj	||j fƒ< qtW x$ˆ j
D ]}ˆ | jdj	||j fƒ< qšW x$ˆ jD ]}ˆ | jdj	||j fƒ< qÀW dS )aM  Adds the FileDescriptorProto and its types to this database.

    Args:
      file_desc_proto: The FileDescriptorProto to add.
    Raises:
      DescriptorDatabaseConflictingDefinitionError: if an attempt is made to
        add a proto with the same name but different definition than an
        exisiting proto in the database.
    z0%s already added, but with different descriptor.c             3   s   | ]}|ˆ fV  qd S )Nr   )Ú.0Úname)Úfile_desc_protor   r   ú	<genexpr>H   s    z)DescriptorDatabase.Add.<locals>.<genexpr>Ú.N)r   r
   r   ÚpackageZmessage_typer   ÚupdateÚ_ExtractSymbolsÚ	enum_typeÚjoinÚ	extensionÚservice)r   r   Z
proto_namer   ÚmessageÚenumr   r   r   )r   r   ÚAdd3   s     


zDescriptorDatabase.Addc             C   s
   | j | S )a¸  Finds the file descriptor proto by file name.

    Typically the file name is a relative path ending to a .proto file. The
    proto with the given name will have to have been added to this database
    using the Add method or else an error will be raised.

    Args:
      name: The file name to find.

    Returns:
      The file descriptor proto matching the name.

    Raises:
      KeyError if no file by the given name was added.
    )r
   )r   r   r   r   r   ÚFindFileByNameS   s    z!DescriptorDatabase.FindFileByNamec             C   s:   y
| j | S  tk
r4   |jdƒ\}}}| j | S X dS )a¢  Finds the file descriptor proto containing the specified symbol.

    The symbol should be a fully qualified name including the file descriptor's
    package and any containing messages. Some examples:

    'some.package.name.Message'
    'some.package.name.Message.NestedEnum'
    'some.package.name.Message.some_field'

    The file descriptor proto containing the specified symbol must be added to
    this database using the Add method or else an error will be raised.

    Args:
      symbol: The fully qualified symbol name.

    Returns:
      The file descriptor proto containing the symbol.

    Raises:
      KeyError if no file contains the specified symbol.
    r   N)r   ÚKeyErrorÚ
rpartition)r   ÚsymbolZ	top_levelÚ_r   r   r   ÚFindFileContainingSymbolf   s
    
z+DescriptorDatabase.FindFileContainingSymbolN)r   r   r   r   r   r   r   r"   r   r   r   r   r	   ,   s
    r	   c             c   sn   |r|d | j  n| j }|V  x(| jD ]}xt||ƒD ]
}|V  q6W q&W x | jD ]}dj||j fƒV  qPW dS )zëPulls out all the symbols from a descriptor proto.

  Args:
    desc_proto: The proto to extract symbols from.
    package: The package containing the descriptor type.

  Yields:
    The fully qualified name found in the descriptor.
  r   N)r   Únested_typer   r   r   )Z
desc_protor   Zmessage_namer#   r    r   r   r   r   r   ˆ   s    
r   N)r   Ú
__author__Ú	Exceptionr   r   Úobjectr	   r   r   r   r   r   Ú<module>   s
   \