§
    ‹Ÿj¨  ã                   óZ   — d Z ddlZddlmZ ddlmZ d„ Z G d„ dee¦  «        ZeZdd	gZ	dS )
z0MQ Frame pure Python methods.é    N)ÚFrameé   )ÚAttributeSetterc                 ó‚   — t           j                             | |¦  «         t           j        st	          d|› �¦  «        ‚d S )Nz6libzmq and pyzmq must be built with draft support for )ÚzmqÚerrorÚ_check_versionÚ	DRAFT_APIÚRuntimeError)ÚvÚfeatures     ú\/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/zmq/sugar/frame.pyÚ_draftr      sK   € Ý„I×Ò˜Q Ñ(Ô(Ð(ÝŒ=ð 
ÝØNÀWÐNÐNñ
ô 
ð 	
ð
ð 
ó    c                   óŠ   — e Zd ZdZd„ Zd„ Zed„ ¦   «         Zej        d„ ¦   «         Zed„ ¦   «         Z	e	j        d„ ¦   «         Z	dS )	r   au  
    A zmq message Frame class for non-copying send/recvs and access to message properties.

    A ``zmq.Frame`` wraps an underlying ``zmq_msg_t``.

    Message *properties* can be accessed by treating a Frame like a dictionary (``frame["User-Id"]``).

    .. versionadded:: 14.4, libzmq 4

        Frames created by ``recv(copy=False)`` can be used to access message properties and attributes,
        such as the CURVE User-Id.

        For example::

            frames = socket.recv_multipart(copy=False)
            user_id = frames[0]["User-Id"]

    This class is used if you want to do non-copying send and recvs.
    When you pass a chunk of bytes to this class, e.g. ``Frame(buf)``, the
    ref-count of `buf` is increased by two: once because the Frame saves `buf` as
    an instance attribute and another because a ZMQ message is created that
    points to the buffer of `buf`. This second ref-count increase makes sure
    that `buf` lives until all messages that use it have been sent.
    Once 0MQ sends all the messages and it doesn't need the buffer of ``buf``,
    0MQ will call ``Py_DECREF(s)``.

    Parameters
    ----------

    data : object, optional
        any object that provides the buffer interface will be used to
        construct the 0MQ message data.
    track : bool
        whether a MessageTracker_ should be created to track this object.
        Tracking a message has a cost at creation, because it creates a threadsafe
        Event object.
    copy : bool
        default: use copy_threshold
        Whether to create a copy of the data to pass to libzmq
        or share the memory with libzmq.
        If unspecified, copy_threshold is used.
    copy_threshold: int
        default: :const:`zmq.COPY_THRESHOLD`
        If copy is unspecified, messages smaller than this many bytes
        will be copied and messages larger than this will be shared with libzmq.
    c                 ó,   — |                       |¦  «        S )N)Úget)ÚselfÚkeys     r   Ú__getitem__zFrame.__getitem__D   s   € à�xŠx˜‰}Œ}Ðr   c                 óV  — t          | ¦  «        }d}|dk    r`t          t          | j        ¦  «        dd…         ¦  «        }|dk    rd}|dz  }n |dk    rd}|d	z  }n|d
k    rd}|d
z  }nd}|}d|d›|› �}n| j        }| j        j        }|dk    rd}d|› d| j        j        › d|›|› d�S )z#Return the str form of the message.Ú é   Né   g    eÍÍAÚGBi   ÚMBg    €„.Ag     @�@ÚkBÚBz...z.0fzzmq.sugar.framer   ú<ú.ú(z)>)ÚlenÚbytesÚ
memoryviewÚbufferÚ	__class__Ú
__module__Ú__name__)r   ÚnbytesÚ
msg_suffixÚ	msg_bytesÚunitÚnÚ_modules          r   Ú__repr__zFrame.__repr__H   sô   € å�T‘”ˆØˆ
Ø�BŠ;ˆ;Ý�j¨¬Ñ5Ô5°c°r°cÔ:Ñ;Ô;ˆIØ˜Š}ˆ}Ø�Ø˜c‘M��Ø˜5’�Ø�Ø˜c‘M��Ø˜3’�Ø�Ø˜c‘M��à�Ø�Ø,˜qÐ,Ð, dÐ,Ð,ˆJˆJàœ
ˆIà”.Ô+ˆØÐ'Ò'Ð'ØˆGØR�7ÐRÐR˜Tœ^Ô4ÐRÐR°yÐRÀJÐRÐRÐRÐRr   c                 óL   — t          dd¦  «         |                      d¦  «        S )z”The RADIO-DISH group of the message.

        Requires libzmq >= 4.2 and pyzmq built with draft APIs enabled.

        .. versionadded:: 17
        ©é   é   ú
RADIO-DISHÚgroup©r   r   ©r   s    r   r5   zFrame.groupc   s&   € õ 	ˆv�|Ñ$Ô$Ð$Ø�xŠx˜Ñ Ô Ð r   c                 óR   — t          dd¦  «         |                      d|¦  «         d S )Nr1   r4   r5   ©r   Úset)r   r5   s     r   r5   zFrame.groupn   s,   € åˆv�|Ñ$Ô$Ð$Ø�Š�˜%Ñ Ô Ð Ð Ð r   c                 óL   — t          dd¦  «         |                      d¦  «        S )zœThe CLIENT-SERVER routing id of the message.

        Requires libzmq >= 4.2 and pyzmq built with draft APIs enabled.

        .. versionadded:: 17
        r1   úCLIENT-SERVERÚ
routing_idr6   r7   s    r   r=   zFrame.routing_ids   s&   € õ 	ˆv�Ñ'Ô'Ð'Ø�xŠx˜Ñ%Ô%Ð%r   c                 óR   — t          dd¦  «         |                      d|¦  «         d S )Nr1   r<   r=   r9   )r   r=   s     r   r=   zFrame.routing_id~   s,   € åˆv�Ñ'Ô'Ð'Ø�Š�˜zÑ*Ô*Ð*Ð*Ð*r   N)
r(   r'   Ú__qualname__Ú__doc__r   r/   Úpropertyr5   Úsetterr=   © r   r   r   r      s²   € € € € € ð-ð -ð^ð ð ðSð Sð Sð6 ð!ð !ñ „Xð!ð „\ð!ð !ñ „\ð!ð ð&ð &ñ „Xð&ð Ôð+ð +ñ Ôð+ð +ð +r   r   ÚMessage)
r@   r   Úzmq.backendr   Ú	FrameBaseÚ	attrsettrr   r   rD   Ú__all__rC   r   r   ú<module>rI      s“   ðØ $Ð $ð
 €
€
€
Ø *Ð *Ð *Ð *Ð *Ð *à &Ð &Ð &Ð &Ð &Ð &ð
ð 
ð 
ðm+ð m+ð m+ð m+ð m+ˆI�ñ m+ô m+ð m+ðb €Ø�IÐ
€€€r   