Ë
    }\;j‚  ã                   ó\   — d Z ddlmZ ddlZddlZddlmZ ddlmZ ddlmZ d„ Z	d
d„Z
d	„ Zy)zDynamic Protobuf class creator.é    )ÚOrderedDictN)Údescriptor_pb2)Ú
descriptor)Úmessage_factoryc                 ó^   — | j                   j                  |«      }| j                  |«      }|S )a8  Get a proto class from the MessageFactory by name.

  Args:
    factory: a MessageFactory instance.
    full_name: str, the fully qualified name of the proto type.
  Returns:
    A class, for the type identified by full_name.
  Raises:
    KeyError, if the proto is not found in the factory's descriptor pool.
  )ÚpoolÚFindMessageTypeByNameÚGetPrototype)ÚfactoryÚ	full_nameÚproto_descriptorÚ	proto_clss       úfG:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\google/protobuf/proto_builder.pyÚ_GetMessageFromFactoryr   *   s0   € ð —\‘\×7Ñ7¸	ÓBÐØ×"Ñ"Ð#3Ó4€)Ø	Ðó    c                 ó„  — t        j                  |¬«      }|�	 t        ||«      }|S | j	                  «       }t        | t        «      st        |«      }t        j                  «       }|D ]N  \  }}|j                  |j                  d«      «       |j                  t        |«      j                  d«      «       ŒP |j                  «       dz   }	|€"d|j                  «       z   }	 t        ||«      }|S |j                  j                  t!        |	||«      «       t        ||«      S # t        $ r Y �Œw xY w# t        $ r Y ŒMw xY w)aê  Create a Protobuf class whose fields are basic types.

  Note: this doesn't validate field names!

  Args:
    fields: dict of {name: field_type} mappings for each field in the proto. If
        this is an OrderedDict the order will be maintained, otherwise the
        fields will be sorted by name.
    full_name: optional str, the fully-qualified name of the proto type.
    pool: optional DescriptorPool instance.
  Returns:
    a class, the new protobuf class with a FileDescriptor.
  )r   zutf-8z.protoz6net.proto2.python.public.proto_builder.AnonymousProto_)r   ÚMessageFactoryr   ÚKeyErrorÚitemsÚ
isinstancer   ÚsortedÚhashlibÚsha1ÚupdateÚencodeÚstrÚ	hexdigestr   ÚAddÚ_MakeFileDescriptorProto)
Úfieldsr   r   r   r   Úfield_itemsÚfields_hashÚf_nameÚf_typeÚproto_file_names
             r   ÚMakeSimpleProtoClassr&   :   sA  € ô ×*Ñ*°Ô5€'àÐðÜ(¨°)Ó<€iØÐð —‘“€+Ü	�FœKÔ	(Ü˜Ó%€Kô —‘“€+Û#�n€fˆfØ×Ñ�v—}‘} WÓ-Ô.Ø×Ñ”s˜6“{×)Ñ)¨'Ó2Õ3ð $ð  ×)Ñ)Ó+¨hÑ6€/ð ÐØIØ×&Ñ&Ó(ñ)€IðÜ(¨°)Ó<€iØÐð 
‡,�,×ÑÜ˜°	¸;ÓGôIä	 ¨Ó	3Ð3øôC ò â
ðûô4 ò á
ðús#   šD# Ã#D3 Ä#	D0Ä/D0Ä3	D?Ä>D?c                 óŒ  — |j                  dd«      \  }}t        j                  «       }t        j                  j                  |j                  dd«      | «      |_        ||_        |j                  j                  «       }||_        t        |d«      D ]®  \  }\  }}	|j                  j                  «       }
||
_        |t        j                  j                  k\  r;|t        j                  j                   t        j                  j                  z
  dz   z  }||
_        t        j$                  j&                  |
_        |	|
_        Œ° |S )zAPopulate FileDescriptorProto for MessageFactory's DescriptorPool.Ú.é   Ú/)Úrsplitr   ÚFileDescriptorProtoÚosÚpathÚjoinÚreplaceÚnameÚpackageÚmessage_typeÚaddÚ	enumerateÚfieldr   ÚFieldDescriptorÚFIRST_RESERVED_FIELD_NUMBERÚLAST_RESERVED_FIELD_NUMBERÚnumberÚFieldDescriptorProtoÚLABEL_OPTIONALÚlabelÚtype)r%   r   r!   r2   r1   Ú
file_protoÚ
desc_protoÚf_numberr#   r$   Úfield_protos              r   r   r   r   s  € à×"Ñ" 3¨Ó*�-€'ˆ4Ü×1Ñ1Ó3€*Ü—G‘G—L‘L §¡°°cÓ!:¸OÓL€*„/Ø€*ÔØ×&Ñ&×*Ñ*Ó,€*Ø€*„/Ü$-¨k¸1Ö$=Ñ €hÑ �˜Ø×"Ñ"×&Ñ&Ó(€KØ€KÔð ”:×-Ñ-×IÑIÒIØÜ
×
$Ñ
$×
?Ñ
?Ü
×
$Ñ
$×
@Ñ
@ñAØCDñEñF€hð "€KÔÜ&×;Ñ;×JÑJ€KÔØ€KÕð %>ð 
Ðr   )NN)Ú__doc__Úcollectionsr   r   r-   Úgoogle.protobufr   r   r   r   r&   r   © r   r   Ú<module>rG      s,   ðñ> &å #Û Û 	å *Ý &Ý +òó 54ópr   