관리-도구
편집 파일: message_factory.cpython-311.pyc
� ���C-$;5����������������������������d�Z�dZddlZddlmZ�ddlmZ�ddlmZ��ej����������������������dk����rddlm Z �ndd lmZ �e j ��������Zd ��Zd��Zd��Z�G�d ��de������������Zdd�ZdS�)ao��Provides a factory class for generating dynamic messages. The easiest way to use this class is if you have access to the FileDescriptor protos containing the messages you want to create you can just do the following: message_classes = message_factory.GetMessages(iterable_of_file_descriptors) my_proto_instance = message_classes['some.proto.package.MessageName']() z"matthewtoia@google.com (Matt Toia)�����N)�api_implementation)�descriptor_pool)�message�python)�python_message)�cpp_messagec������������������J�����t����������|�dd������������}|r|S�t����������|�������������S�)a7��Obtains a proto2 message class based on the passed in descriptor. Passing a descriptor with a fully qualified name matching a previous invocation will cause the same class to be returned. Args: descriptor: The descriptor to build from. Returns: A class describing the passed in descriptor. �_concrete_classN)�getattr�_InternalCreateMessageClass)� descriptor�concrete_classs��� ��/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib64/python3.11/site-packages/google/protobuf/message_factory.py�GetMessageClassr���:���s2��������:�'8�$�?�?�.������ $�Z� 0� 0�0�����c������������������d����i�}|�D�]�}|����������������������|������������}|j�������������������������������������������D�]}t����������|������������||j��������<����|j�������������������������������������������D�]F}t����������|j��������������������}|���������������������|�������������|j��������rt����������|j����������������������G��|S�)ak��Gets all the messages from specified files. This will find and resolve dependencies, failing if the descriptor pool cannot satisfy them. Args: files: The file names to extract messages from. pool: The descriptor pool to find the files including the dependent files. Returns: A dictionary mapping proto names to the message classes. ) �FindFileByName�message_types_by_name�valuesr���� full_name�extensions_by_name�containing_type�RegisterExtension�message_type)�files�pool�result� file_name� file_desc�desc� extension�extended_classs��� r����GetMessageClassesForFilesr#���L���s���������&���0��0�i��#�#�I�.�.�I��/�6�6�8�8��5��5��.�t�4�4�f�T�^�����1�8�8�:�:��0��0� �&�y�'@�A�A�n��&�&�y�1�1�1�� � ��0�� �.�/�/�/��0�� �-r���c������������������B����|�j���������}t����������|t����������j��������f|�dd�������������}|�j��������D�]}|j��������rt ����������|j����������������������|j��������j��������D�]F}t ����������|j ��������������������}|� ��������������������|�������������|j��������rt ����������|j����������������������G|S�)z�Builds a proto2 message class based on the passed in descriptor. Args: descriptor: The descriptor to build from. Returns: A class describing the passed in descriptor. N)� DESCRIPTOR� __module__)�name� _GENERATED_PROTOCOL_MESSAGE_TYPEr����Message�fieldsr���r���r%���� extensionsr���r���)r ����descriptor_name�result_class�fieldr!���r"���s��� r���r���r���t���s���������O�/�1�����"����� �� �,��� ��*��*�e����*��e�(�)�)�)���*�5��.��.�i�$�Y�%>�?�?�N��$�$�Y�/�/�/����.��i�,�-�-�-�� �r���c��������������������,�����e�Zd�ZdZdd�Zd��Zd��Zd��ZdS�)�MessageFactoryz@Factory for creating Proto2 messages from descriptors in a pool.Nc������������������:�����|pt����������j����������������������|�_��������dS�)zInitializes a new factory.N)r����DescriptorPoolr���)�selfr���s��� r����__init__zMessageFactory.__init__����s�������8��6�8�8�D�I�I�Ir���c������������������H�����t����������j��������d�������������t����������|������������S�)aE��Obtains a proto2 message class based on the passed in descriptor. Passing a descriptor with a fully qualified name matching a previous invocation will cause the same class to be returned. Args: descriptor: The descriptor to build from. Returns: A class describing the passed in descriptor. z�MessageFactory class is deprecated. Please use GetMessageClass() instead of MessageFactory.GetPrototype. MessageFactory class will be removed after 2024.)�warnings�warnr����r3���r ���s��� r����GetPrototypezMessageFactory.GetPrototype����s1������� �M��E��F��F��F���:�&�&�&r���c������������������H�����t����������j��������d�������������t����������|������������S�)a,��Builds a proto2 message class based on the passed in descriptor. Don't call this function directly, it always creates a new class. Call GetMessageClass() instead. Args: descriptor: The descriptor to build from. Returns: A class describing the passed in descriptor. z�Directly call CreatePrototype is wrong. Please use GetMessageClass() method instead. Directly use CreatePrototype will raise error after July 2023.)r6���r7���r���r8���s��� r����CreatePrototypezMessageFactory.CreatePrototype����s1������� �M��F��G��G��G��'�z�2�2�2r���c������������������T�����t����������j��������d�������������t����������||�j��������������������S�)a���Gets all the messages from a specified file. This will find and resolve dependencies, failing if the descriptor pool cannot satisfy them. Args: files: The file names to extract messages from. Returns: A dictionary mapping proto names to the message classes. This will include any dependent messages as well as any messages defined in the same file as a specified message. z�MessageFactory class is deprecated. Please use GetMessageClassesForFiles() instead of MessageFactory.GetMessages(). MessageFactory class will be removed after 2024.)r6���r7���r#���r���)r3���r���s��� r����GetMessageszMessageFactory.GetMessages����s1������� �M��0��1��1��1��%�U�D�I�6�6�6r����N)�__name__r&����__qualname__�__doc__r4���r9���r;���r=�����r���r���r0���r0�������s[��������������H�H�9��9��9��9�'��'��'�"3��3��3�"7��7��7��7��7r���r0���c���������������������������|pt����������j�����������������������d��|�D�������������������fd���r%��������������������������������������d������������������������%t����������d��|�D����������������������������S�)a���Builds a dictionary of all the messages available in a set of files. Args: file_protos: Iterable of FileDescriptorProto to build messages out of. pool: The descriptor pool to add the file protos. Returns: A dictionary mapping proto names to the message classes. This will include any dependent messages as well as any messages defined in the same file as a specified message. c�����������������������i�|�] }|j���������|��S�rB����r'�����.0� file_protos��� r���� <dictcomp>zGetMessages.<locals>.<dictcomp>����s������L�L�L�*�*�/�:�L�L�Lr���c������������������������|�j���������D�]$}|�v�r������������������������|��������������������������%����������������������|��������������d�S�r>���)� dependency�pop�Add)rH���rK����_AddFile�des_pool�file_by_names��� ���r���rN���zGetMessages.<locals>._AddFile����sW������� �+��/��/� � �|� #� #����!�!�*�-�-�.�.�.���L�L������r�������c�����������������������g�|�] }|j����������� S�rB���rE���rF���s��� r���� <listcomp>zGetMessages.<locals>.<listcomp>����s������5�5�5�:�z��5�5�5r���)r���r2����popitemr#���)�file_protosr���rN���rO���rP���s��� @@@r���r=���r=�������s������������ 5�_�3�5�5�(�L�L��L�L�L�,��������������� ��(��H�\� !� !� #� #�A� &�'�'�'�� ��(� "�5�5��5�5�5�x� A�� A��Ar���r>���)rA���� __author__r6����google.protobuf.internalr����google.protobufr���r����Typer����message_impl�google.protobuf.pyextr����GeneratedProtocolMessageTyper(���r���r#���r����objectr0���r=���rB���r���r����<module>r^������s����>����2� �������7��7��7��7��7��7��+��+��+��+��+��+��#��#��#��#��#��#�������(�(�E�E�E�E�E�E�E�?�?�?�?�?�?��$0�#L�� �1��1��1�$%��%��%�P�����>;7��;7��;7��;7��;7�V��;7��;7��;7�|A��A��A��A��A��Ar���