
    q	h0                     \    S r SrSSKr " S S\5      r " S S\5      r " S S	\5      rS
 rg)z*Provides a container for DescriptorProtos.z"matthewtoia@google.com (Matt Toia)    Nc                       \ rS rSrSrg)Error    N)__name__
__module____qualname____firstlineno____static_attributes__r       U/var/www/html/env/lib/python3.13/site-packages/google/protobuf/descriptor_database.pyr   r      s    r   r   c                       \ rS rSrSrSrg),DescriptorDatabaseConflictingDefinitionError   zGRaised when a proto is added with the same name & different descriptor.r   N)r   r   r	   r
   __doc__r   r   r   r   r   r      s    Or   r   c                   B    \ rS rSrSrS rS rS rS rS r	S r
S	 rS
rg)DescriptorDatabase   zEA container accepting FileDescriptorProtos and maps DescriptorProtos.c                      0 U l         0 U l        g N_file_desc_protos_by_file_file_desc_protos_by_symbol)selfs    r   __init__DescriptorDatabase.__init__   s    %'D"')D$r   c                    UR                   nX R                  ;  a  XR                  U'   O"U R                  U   U:w  a  [        SU-  5      egUR                  nUR                   H&  n[        XC5       H  nU R                  XQ5        M     M(     UR                   H  nU R                  U(       a  SR                  X6R                   45      OUR                   U5        UR                   H?  nUU R                  U(       a  SR                  X7R                   45      OUR                   '   MA     M     UR                   HB  nU R                  U(       a  SR                  X8R                   45      OUR                   U5        MD     UR                   HB  n	U R                  U(       a  SR                  X9R                   45      OU	R                   U5        MD     g)a0  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
    existing proto in the database.
z0%s already added, but with different descriptor.N.)namer   r   packagemessage_type_ExtractSymbols
_AddSymbol	enum_typejoinvaluer   	extensionservice)
r   file_desc_proto
proto_namer    messager   enum
enum_valuer'   r(   s
             r   AddDescriptorDatabase.Add   s    !%%J7773B$$Z0		'	'
	3	F8
<z
IK K  %%G"//!'3$. 4 0  ))
oo-4388Wii()$))
 

*  	((4;CHHg/0	
 # * %..	
oo29388Wnn-.y~~
 /
 #**
oo07388Wll+,W\\
 +r   c                      U R                   U   $ )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   s     r   FindFileByName!DescriptorDatabase.FindFileByNameJ   s    " ))$//r   c                 R   UR                  S5      S:X  a5  US   S:X  a,  UR                  S5      n[        R                  " S[        5         U R
                  U   $ ! [         aA    UR                  S5      u  n  n U R
                  U   s $ ! [         a    [        U5      ef = ff = f)aj  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      r   zaPlease remove the leading "." when FindFileContainingSymbol, this will turn to error in 2026 Jan.)countlstripwarningswarnRuntimeWarningr   KeyError
rpartition)r   symbol	top_level_s       r   FindFileContainingSymbol+DescriptorDatabase.FindFileContainingSymbol]   s    , ||CA&)s"2}}S!fmm 	--f55  ))#.oiA//	:: vs$   A B&;B	B&B""B&c                     g r   r   )r   extendee_nameextension_numbers      r   FindFileContainingExtension.DescriptorDatabase.FindFileContainingExtension   s    r   c                     / $ r   r   )r   rB   s     r   FindAllExtensionNumbers*DescriptorDatabase.FindAllExtensionNumbers   s    Ir   c                     XR                   ;   aP  SUR                  -   S-   U-   S-   U R                   U   R                  -   S-   n[        R                  " U[        5        X R                   U'   g )NzConflict register for file "z": z is already defined in file "")r   r   r7   r8   r9   )r   r   r)   warn_msgs       r   r#   DescriptorDatabase._AddSymbol   s|    ///0?3G3GG12 2248==> ADDh mmHn--<$$T*r   r   N)r   r   r	   r
   r   r   r.   r1   r?   rD   rG   r#   r   r   r   r   r   r      s*    M**X0&+Z=r   r   c              #     #    U(       a  US-   U R                   -   OU R                   nUv   U R                   H  n[        X25       H  nUv   M	     M     U R                   H!  nSR	                  X%R                   45      v   M#     g7f)zPulls 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%   )
desc_protor    message_namerN   r<   r$   s         r   r"   r"      ss      5<30,++k!+<l = , ''i
((L..1
22 (s   BB)	r   
__author__r7   	Exceptionr   r   objectr   r"   r   r   r   <module>rT      s@    11
 I P5 PB= B=J3r   