AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/twisted/positioning/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/twisted/positioning/__pycache__/_sentence.cpython-310.pyc
o

�bp�@s0dZddlmZGdd�d�ZGdd�d�ZdS)z6
Generic sentence handling tools: hopefully reusable.
�)�Setc@sNeZdZUdZe�Zeeed<dd�Z	e
dd��Zdd�Zd	efd
d�Z
dS)
�
_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_ATTRIBUTEScCs
||_dS)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�sentenceData�r�?/usr/lib/python3/dist-packages/twisted/positioning/_sentence.py�__init__(s
z_BaseSentence.__init__cCs
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)rrrr	�presentAttributes1s
	z_BaseSentence.presentAttributescCs8||jvr|j�|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�msgrrr	�__getattr__<s

z_BaseSentence.__getattr__�returncCsV|j��}dd�t|�D�}d�|�}|j�d�pd}|jj}d|�d|�d|�d	�S)
z�
        Returns a textual representation of this sentence.

        @return: A textual representation of this sentence.
        @rtype: C{str}
        cSs&g|]\}}|dkr|�d|���qS)�typez: r)�.0�k�vrrr	�
<listcomp>Os&z*_BaseSentence.__repr__.<locals>.<listcomp>z, rzunknown type�<z (z) {z}>)r�items�sorted�joinr
rr)rr�data�dataRepr�typeReprrrrr	�__repr__Gs

z_BaseSentence.__repr__N)r�
__module__�__qualname__�__doc__�setrr�str�__annotations__r
�propertyrrr"rrrr	r	s
	

rc@seZdZdZedd��ZdS)�!_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.
    cCs8dh}|j��D]}|D]}|durq|�|�qq|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}
        rN)�_SENTENCE_CONTENTS�values�add)�cls�
attributes�
attributeList�	attributerrr	�getSentenceAttributescs�z7_PositioningSentenceProducerMixin.getSentenceAttributesN)rr#r$r%�classmethodr2rrrr	r*Xs
r*N)r%�typingrrr*rrrr	�<module>sO

Anon7 - 2022
AnonSec Team