ó
    Ö›‘hp  ã                   ó<   • S r SSKJr   " S S5      r " S S5      rg)z6
Generic sentence handling tools: hopefully reusable.
é    )ÚSetc                   ób   • \ rS rSr% Sr\" 5       r\\   \	S'   S r
\S 5       rS rS\4S jrS	rg
)Ú_BaseSentenceé	   aÙ  
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                 ó   • Xl         g)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     ÚaC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/positioning/_sentence.pyÚ__init__Ú_BaseSentence.__init__(   s
   € ð *Õó    c                 ó,   • [        U R                  5      $ )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   ÚpresentAttributesÚ_BaseSentence.presentAttributes1   s   € ô �D×&Ñ&Ó'Ð'r   c                 óª   • XR                   ;   a  U R                  R                  US5      $ U R                  R                  nU SU S3n[        U5      e)z%
Gets an attribute of this sentence.
Nz sentences have no z attributes)r   r
   ÚgetÚ	__class__Ú__name__ÚAttributeError)r   ÚnameÚ	classNameÚmsgs       r   Ú__getattr__Ú_BaseSentence.__getattr__<   sV   € ð ×*Ñ*Ó*Ø×%Ñ%×)Ñ)¨$°Ó5Ð5àŸ™×/Ñ/ˆIØ�KÐ2°4°&¸ÐDˆCÜ  Ó%Ð%r   Úreturnc                 óH  • U R                   R                  5       n[        U5       VVs/ s H  u  p#US:w  d  M  U SU 3PM     nnnSR                  U5      nU R                   R	                  S5      =(       d    SnU R
                  R                  nSU SU SU S3$ s  snnf )	zx
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Újoinr   r   r   )r   r#   ÚkÚvÚdataÚdataReprÚtypeReprr   s           r   Ú__repr__Ú_BaseSentence.__repr__G   sœ   € ð ×"Ñ"×(Ñ(Ó*ˆÜ(.¨u¬ÔEª¡ ¸¸f¹“�1�#�R˜�s“©ˆÑEØ—9‘9˜T“?ˆà×%Ñ%×)Ñ)¨&Ó1×C°^ˆØ—N‘N×+Ñ+ˆ	à�9�+˜R ˜z¨¨h¨Z°sÐ;Ð;ùó Fs
   ©B¹Br	   N)r   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úsetr   r   ÚstrÚ__annotations__r   Úpropertyr   r   r+   Ú__static_attributes__© r   r   r   r   	   sD   ‡ ññ8 $'£5Ð˜˜C™Ó(ò*ð ñ(ó ð(ò	&ð<˜#÷ <r   r   c                   ó(   • \ rS rSrSr\S 5       rSrg)Ú!_PositioningSentenceProducerMixinéX   a�  
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                 óŒ   • S1nU R                   R                  5        H"  nU H  nUc  M  UR                  U5        M     M$     U$ )a  
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   ÚgetSentenceAttributesÚ7_PositioningSentenceProducerMixin.getSentenceAttributesc   sK   € ð �Xˆ
Ø ×3Ñ3×:Ñ:Ö<ˆMÛ*�	ØÑ$ÙØ—‘˜yÖ)ó +ñ =ð Ðr   r6   N)r   r-   r.   r/   r0   ÚclassmethodrB   r5   r6   r   r   r8   r8   X   s   † ñð ñó ór   r8   N)r0   Útypingr   r   r8   r6   r   r   Ú<module>rF      s&   ðñõ ÷L<ñ L<÷^ò r   