%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/positioning/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/positioning/__pycache__/_sentence.cpython-312.pyc

�

Ϫ�fp��<�dZddlmZGd�d�ZGd�d�Zy)z6
Generic sentence handling tools: hopefully reusable.
�)�Setc�X�eZdZUdZe�Zeeed<d�Z	e
d��Zd�Zdefd�Z
y)	�
_BaseSentencea-
    A base sentence class for a particular protocol.

    Using this base class, specific sentence classes can almost automatically
    be created for a particular protocol.
    To do this, fill the ALLOWED_ATTRIBUTES class attribute using
    the C{getSentenceAttributes} class method of the producer::

        class FooSentence(BaseSentence):
            """
            A sentence for integalactic transmodulator sentences.

            @ivar transmogrificationConstant: The value used in the
                transmogrifier while producing this sentence, corrected for
                gravitational fields.
            @type transmogrificationConstant: C{Tummy}
            """
            ALLOWED_ATTRIBUTES = FooProtocol.getSentenceAttributes()

    @ivar presentAttributes: An iterable containing the names of the
        attributes that are present in this sentence.
    @type presentAttributes: iterable of C{str}

    @cvar ALLOWED_ATTRIBUTES: A set of attributes that are allowed in this
        sentence.
    @type ALLOWED_ATTRIBUTES: C{set} of C{str}
    �ALLOWED_ATTRIBUTESc��||_y)z�
        Initializes a sentence with parsed sentence data.

        @param sentenceData: The parsed sentence data.
        @type sentenceData: C{dict} (C{str} -> C{str} or L{None})
        N)�
_sentenceData)�self�sentenceDatas  �?/usr/lib/python3/dist-packages/twisted/positioning/_sentence.py�__init__z_BaseSentence.__init__(s��*���c�,�t|j�S)z�
        An iterable containing the names of the attributes that are present in
        this sentence.

        @return: The iterable of names of present attributes.
        @rtype: iterable of C{str}
        )�iterr)r	s r�presentAttributesz_BaseSentence.presentAttributes1s���D�&�&�'�'r
c��||jvr|jj|d�S|jj}|�d|�d�}t|��)z5
        Gets an attribute of this sentence.
        Nz sentences have no z attributes)rr�get�	__class__�__name__�AttributeError)r	�name�	className�msgs    r�__getattr__z_BaseSentence.__getattr__<sX���4�*�*�*��%�%�)�)�$��5�5����/�/�I��K�2�4�&��D�C� ��%�%r
�returnc�6�|jj�}t|�D��cgc]\}}|dk7s�|�d|����}}}dj|�}|jj	d�xsd}|j
j}d|�d|�d|�d�Scc}}w)	z�
        Returns a textual representation of this sentence.

        @return: A textual representation of this sentence.
        @rtype: C{str}
        �typez: z, zunknown type�<z (z) {z}>)r�items�sorted�joinrrr)r	r�k�v�data�dataRepr�typeReprrs        r�__repr__z_BaseSentence.__repr__Gs����"�"�(�(�*��(.�u�
�E���1��f��1�#�R��s��E��E��9�9�T�?���%�%�)�)�&�1�C�^���N�N�+�+�	��9�+�R��z��h�Z�s�;�;��
Fs
�
B�	BN)r�
__module__�__qualname__�__doc__�setrr�str�__annotations__r�propertyrrr&�r
rrr	sD���8$'�5���C��(�*��(��(�	&�<�#�<r
rc� �eZdZdZed��Zy)�!_PositioningSentenceProducerMixina�
    A mixin for certain protocols that produce positioning sentences.

    This mixin helps protocols that store the layout of sentences that they
    consume in a C{_SENTENCE_CONTENTS} class variable provide all sentence
    attributes that can ever occur. It does this by providing a class method,
    C{getSentenceAttributes}, which iterates over all sentence types and
    collects the possible sentence attributes.
    c��dh}|jj�D]}|D]}|��|j|���|S)aR
        Returns a set of all attributes that might be found in the sentences
        produced by this protocol.

        This is basically a set of all the attributes of all the sentences that
        this protocol can produce.

        @return: The set of all possible sentence attribute names.
        @rtype: C{set} of C{str}
        r)�_SENTENCE_CONTENTS�values�add)�cls�
attributes�
attributeList�	attributes    r�getSentenceAttributesz7_PositioningSentenceProducerMixin.getSentenceAttributescsU���X�
� �3�3�:�:�<�	*�M�*�
*�	��$�����y�)�
*�	*��r
N)rr'r(r)�classmethodr9r.r
rr0r0Xs������r
r0N)r)�typingrrr0r.r
r�<module>r<s&����L<�L<�^�r

Zerion Mini Shell 1.0