;i;bddlZddlZddlZddlZddlmZmZmZmZm Z ddl Z ddl Z ddl m Z ddl mZddlmZmZmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZe j j!Z"eZ#Gdde$Z%Gdde%Z&GddZ'dZ(dS)N)AnyDictListOptionalType)descriptor_pb2)message) MessageToDict MessageToJsonParse) _file_info) _package_info)Field)MapField) RepeatedField)Marshal) ProtoType)has_upbc^eZdZdZfdZedZedZdZ dddd e fd Z fd Z d e fd Zde d dfdZdee d dfdZdee dee d dfdZdee dee d e fdZddddddddd efdZddd dZddddddd eeeffdZdZxZS)! MessageMetaz=D}|D]F}|j?,@|j>;|Gfd |jA=D}|D]F}|jB,@|jA;|GtKdkr2|j&jC,@|n ||j><t| ||||!|d<t||||}||j0_E|j0jFGD] } || _E ||jH|<|I|"r|J||#|S)%N __qualname__.zz{pascal_key}Entryz_\wc^|ddS)Nr)groupupper)ms AC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\proto/message.pyz%MessageMeta.__new__..Os"aggiim1133r) pascal_key __module__z{prefix}.{name})prefixname map_entryT)r#r _pb_optionsnumberkey)r)enumr value)r)r )r% parent_nameindexpackagepb_metaz_{} AttrsMetar'cg|] }|j S) descriptor.0is r z'MessageMeta.__new__..s000A1<000r!c8g|]}tj|S)r%)rOneofDescriptorProtor7s rr:z'MessageMeta.__new__..s3@A3;;;r!)r%field oneof_decloptionsc0g|]}|ddk|SNr5r8p local_paths rr:z'MessageMeta.__new__..s+RRRQZ1SbS6=Q=Qq=Q=Q=Qr!c0g|]}|ddk|SrBr5rDs rr:z'MessageMeta.__new__..s0WWWQ*PQRUSURUPVBVBVqBVBVBVr!)fields full_namemarshalr@r0) new_class)rK fallback_saltr5)Ksuper__new__rcompiletuplegetsplitr/joinlstripitems isinstancerformatresubreplacer collections OrderedDictr map_key_type proto_typer,r rMessagerrMESSAGEr)updateset mcls_dataappendoneof setdefaultlenr6 oneof_indexstrhasattrcallabler1add DESCRIPTORfiler%r2optionaltyper _FileInfoproto_file_namelowermaybe_add_descriptor dependencyrMessageOptionspopDescriptorProtokeysnested nested_type MergeFrom nested_enum enum_type message_type _MessageInfoparentrHvaluesmessagesreadygenerate_file_pb)mclsr%basesattrsr0rJixrI map_fieldsr*r>msg_name entry_attrsrH new_attrsoneofs proto_importsr/ field_msg field_enum opt_attrsfilename file_info proto_importoptsdesc child_paths child_pathclsrF __class__s @rrNzMessageMeta.__new__-s =77??4ue<< <)0u==599^T::@@EEFF   # #!!*--B#Hb1fH- 26880DDJHHgZ*455<>%%=%%%0#6   K"'u'9!!D!D!DK #( Z $$$K $/x'[#Q#QJx ,!|"8,JsOO  Z    (** ++--7 7 JCeU++ !& # (" EO MM% { C!!%+s6{{;;;/5ek/B , } ">WWW % R RJ N   * *9+@+D+DZ+P+P Q Q Q Q z??a    - 1 1 3 3 = =d C C C C+/I Z (*    'ggoodD%;; Y%,,..  EELL ), 9% ??S? ) ) O  & &I & N N N r!c (tjSN)r[r\)rr%rkwargss r __prepare__zMessageMeta.__prepare__s&(((r!c|jSr)r2)rs rmetazMessageMeta.meta s yr!c~ ttt}|d|j}|d|jD|d|jD|S#t$rttcYSwxYw)N) rr1wrap serialize deserializeto_json from_jsonto_dict copy_fromc3$K|] }|jV dSrr<)r8ts r z&MessageMeta.__dir__..5s$;;A;;;;;;r!c3$K|] }|jV dSrr<r8es rrz&MessageMeta.__dir__..6s$99A999999r!) rbdirrprar1rm nested_types enum_typesAttributeError)selfnamesrs r__dir__zMessageMeta.__dir__$s D NNE LL    7799'D LL;;):;;; ; ; ; LL99999 9 9 9L   t99    sBBB<;B<NFcoercerc| |jjSt||s'|r ||}nt|d|j|jS)aHReturn the underlying protobuf Message class or instance. Args: obj: If provided, and an instance of ``cls``, return the underlying protobuf instance. coerce (bool): If provided, will attempt to coerce ``obj`` to ``cls`` if it is not already an instance. Nz is not an instance of )rr1rV TypeError__name___pb)robjrs rr1zMessageMeta.pb<sl ;8; #s##  c#hh wr!cz||}t||d||S)zReturn a Message object that shallowly wraps the descriptor. Args: pb: A protocol buffer object, such as would be returned by :meth:`pb`. r)rNrM __setattr__)rr1instancers rrzMessageMeta.wrapTs;;;s## c8((333r!returncT||dS)aReturn the serialized proto. Args: instance: An instance of this message type, or something compatible (accepted by the type's constructor). Returns: bytes: The serialized representation of the protocol buffer. Tr)r1SerializeToString)rrs rrzMessageMeta.serialize`s&vvhtv,,>>@@@r!payloadr_cv|||S)aGiven a serialized proto, deserialize it into a Message instance. Args: payload (bytes): The serialized proto. Returns: ~.Message: An instance of the message class against which this method was called. )rr1 FromString)rrs rrzMessageMeta.deserializels,xx++G44555r!including_default_value_fieldscdtddvr|tjdtdSdSdS)z Warn Protobuf 5.x+ users that `including_default_value_fields` is deprecated if it is set. Args: including_default_value_fields (Optional(bool)): The value of `including_default_value_fields` set by the user. r34NzThe argument `including_default_value_fields` has been removed from Protobuf 5.x. Please use `always_print_fields_with_no_presence` instead. )PROTOBUF_VERSIONwarningswarnDeprecationWarning)rrs r:_warn_if_including_default_value_fields_is_used_protobuf_5zFMessageMeta._warn_if_including_default_value_fields_is_used_protobuf_5xsP Q z 1 1.: M#       2 1::r!$always_print_fields_with_no_presencec@||||krtddSdSdS)a Raise Exception if both `always_print_fields_with_no_presence` and `including_default_value_fields` are set and the values differ. Args: always_print_fields_with_no_presence (Optional(bool)): The value of `always_print_fields_with_no_presence` set by the user. including_default_value_fields (Optional(bool)): The value of `including_default_value_fields` set by the user. Returns: None Raises: ValueError: if both `always_print_fields_with_no_presence` and `including_default_value_fields` are set and the values differ. Nz`Arguments `always_print_fields_with_no_presence` and `including_default_value_fields` must match) ValueErrorrrrs r0_raise_if_print_fields_values_are_set_and_differzz"Message.__dir__..s???F???r!c3$K|] }|jV dSrr<)r8rs rrz"Message.__dir__..s$77QV777777r!c3$K|] }|jV dSrr<rs rrz"Message.__dir__..s$55QV555555r!)__bool__ __contains____dict__ __getattr__ __getstate__r# __setstate__ __weakref__) rpr1rmr2rHryrarrrobject)rrrs rrzMessage.__dir__sDzz}})??dj&7&<&<&>&>??? 77T%6777777 55T_555555 S]]###     r!crtfdjjDS)z4Return True if any field is truthy, False otherwise.c3@K|]}|vot|VdSr)getattr)r8krs rrz#Message.__bool__..s6TTa191q!1!1TTTTTTr!)anyr2rHryrs`rrzMessage.__bool__s7TTTT4:;L;Q;Q;S;STTTTTTr!ct|j|} |j|S#t$rt |cYSwxYw)aRReturn True if this field was set to something non-zero on the wire. In most cases, this method will return True when ``__getattr__`` would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful. The exception case is empty messages explicitly set on the wire, which are falsy from ``__getattr__``. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases. The most common edge case is the use of ``google.protobuf.BoolValue`` to get a boolean that distinguishes between ``False`` and ``None`` (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accommodate cases not automatically covered. Args: key (str): The name of the field. Returns: bool: Whether the field's value corresponds to a non-empty wire serialization. )rrHasFieldrr)rr*rs rrzMessage.__contains__s_248S)) "8$$S)) ) " " ">> ! ! ! "s1A  A c:|j|dS)zmDelete the value on the given field. This is generally equivalent to setting a falsy value. N)r ClearField)rr*s r __delattr__zMessage.__delattr__?s C     r!ct|t|r|j|jkSt||jjr |j|kSt S)z7Return True if the messages are equal, False otherwise.)rVrprr2r1NotImplementedrrs r__eq__zMessage.__eq__FsX eT$ZZ ( ( )8uy( ( eTZ] + + %8u$ $r!c||\}}|-td|jj|t |j|}|jj}| ||||vS)aRetrieve the given field's value. In protocol buffers, the presence of a field on a message is sufficient for it to always be "present". For primitives, a value of the correct type will always be returned (the "falsy" values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence. For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use ``key in self`` (in other words, ``__contains__``). .. note:: Some well-known protocol buffer types (e.g. ``google.protobuf.Timestamp``) will be converted to their Python equivalents. See the ``marshal`` module for more details. Nr)absent) rrrWrrrrr2rJ to_python)rr*rrrJs rrzMessage.__getattr__Ss033C88g ? *11$.2I3OO 48S))*$  (3d? KKKr!c||k S)z9Return True if the messages are unequal, False otherwise.r5rs r__ne__zMessage.__ne__ts5=  r!c*t|jSr)reprrrs r__repr__zMessage.__repr__xsDH~~r!c|ddkr"t||S|jj}||\}}|-t d|jj|| ||}|j ||.|j |jj di||idSdS)zSet the value on the given field. For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted. rrNrr5)rMrr2rJrrrWrrrrrr|r1)rr*r-rJrrrs rrzMessage.__setattr__{s q6S==77&&sE22 2*$33C88g ? *11$.2I3OO ##GU33 C      H  }tz}??X?? @ @ @ @ @ r!c4|jS)zSerialize for pickling.)rrrs rrzMessage.__getstate__sx))+++r!c|j|}td|dS)zDeserialization for pickling.rN)r2r1rrMr)rr-new_pbrs rr zMessage.__setstate__s@++E22 E6*****r!r)rr#rrrrrrrrrrrr"rrr rrs@rr_r_s9  H<$ H<H<H<H<H<H<H.s(-J-Jaqvqk-J-J-J-J-J-Jr!c3(K|] }|j|fVdSrr(r7s rrz(_MessageInfo.__init__..s(7V7V!1 7V7V7V7V7V7Vr!) r0rIr@r[r\rHfields_by_numberrJr)rrHr0rIrJr@s rrz_MessageInfo.__init__sn " !--J-J6-J-J-JJJ + 77V7Vv7V7V7V V V r!c|jS)zReturn the protobuf message type for this descriptor. If a field on the message references another message which has not loaded, then this method returns None. )rrs rr1z_MessageInfo.pbs xr!)rr#rrrrrirrrvrrrr r_r1r5r!rrrs  U       . "D)Xr!r)r_))r[collections.abcrrXtypingrrrrrrgoogle.protobufgooglerr google.protobuf.json_formatr r r protor r proto.fieldsrrr proto.marshalrproto.primitivesr proto.utilsrprotobuf __version__r_upbrprr_r__all__r5r!rr<s 22222222222222******######KKKKKKKKKK!!!!!!&&&&&&!!!!!!&&&&&&?.wyy\ )\ )\ )\ )\ )$\ )\ )\ )~S+S+S+S+S+ S+S+S+S+l''''''''T r!