%PDF- %PDF-
Mini Shell

Mini Shell

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

�

Ϫ�f
���dZddlmZGd�de�ZGd�d�ZGd�d�ZGd	�d
�ZGd�de�Z	Gd
�de�Z
Gd�de
�ZGd�de
�Zy)zf
Twisted Python Roots: an abstract hierarchy representation for Twisted.

Maintainer: Glyph Lefkowitz
�)�reflectc��eZdZdZy)�NotSupportedErrorzv
    An exception meaning that the tree-manipulation operation
    you're attempting to perform is not supported.
    N��__name__�
__module__�__qualname__�__doc__���6/usr/lib/python3/dist-packages/twisted/python/roots.pyrrs��rrc� �eZdZdZdZd�Zd�Zy)�Requestz�I am an abstract representation of a request for an entity.

    I also function as the response.  The request is responded to by calling
    self.write(data) until there is no data left and then calling
    self.finish().
    Nc�X�tdtj|j�z��)z.Add some data to the response to this request.z%s.write��NotImplementedErrorr�qual�	__class__)�self�datas  r
�writez
Request.write"s��!�*�w�|�|�D�N�N�/K�"K�L�Lrc�X�tdtj|j�z��)zOThe response to this request is finished; flush all data to the network stream.z	%s.finishr�rs r
�finishzRequest.finish&s��!�+����T�^�^�0L�"L�M�Mr)rrr	r
�wireProtocolrrrrr
rrs����L�M�Nrrc��eZdZdZd�Zy)�EntityaZI am a terminal object in a hierarchy, with no children.

    I represent a null interface; certain non-instance objects (strings and
    integers, notably) are Entities.

    Methods on this class are suggested to be implemented, but are not
    required, and will be emulated on a per-protocol basis for types which do
    not handle them.
    c�X�tdtj|j�z��)zw
        I produce a stream of bytes for the request, by calling request.write()
        and request.finish().
        z	%s.renderr�r�requests  r
�renderz
Entity.render6s!��
"�+����T�^�^�0L�"L�M�MrN)rrr	r
r!rrr
rr+s
���Nrrc�f�eZdZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zy)�
Collectionz�I represent a static collection of entities.

    I contain methods designed to represent collections that can be dynamically
    created.
    Nc�&�|�||_yi|_y)zInitialize me.N��entities)rr&s  r
�__init__zCollection.__init__Es����$�D�M��D�Mrc�8�|jj|�S)zqGet an entity that was added to me using putEntity.

        This method will return 'None' if it fails.
        )r&�get�r�names  r
�getStaticEntityzCollection.getStaticEntityLs��
�}�}� � ��&�&rc��y)znSubclass this to generate an entity on demand.

        This method should return 'None' if it fails.
        Nr�rr+r s   r
�getDynamicEntityzCollection.getDynamicEntitySs�rc�Z�|j|�}|�|S|j||�}|�|Sy)aRetrieve an entity from me.

        I will first attempt to retrieve an entity statically; static entities
        will obscure dynamic ones.  If that fails, I will retrieve the entity
        dynamically.

        If I cannot retrieve an entity, I will return 'None'.
        N)r,r/)rr+r �ents    r
�	getEntityzCollection.getEntityYs=���"�"�4�(���?��J��#�#�D�'�2���?��J�rc�"�||j|<y)zlStore a static reference on 'name' for 'entity'.

        Raises a KeyError if the operation fails.
        Nr%�rr+�entitys   r
�	putEntityzCollection.putEntityjs��
%��
�
�d�rc��|j|=y)zaRemove a static reference for 'name'.

        Raises a KeyError if the operation fails.
        Nr%r*s  r
�	delEntityzCollection.delEntityqs��

�M�M�$�rc�X�tdtj|j�z��)z>Store an entity for 'name', based on the content of 'request'.z%s.storeEntity�rrrrr.s   r
�storeEntityzCollection.storeEntityxs ��� 0�7�<�<����3O� O�P�Prc�X�tdtj|j�z��)z?Remove an entity for 'name', based on the content of 'request'.z%s.removeEntityr:r.s   r
�removeEntityzCollection.removeEntity|s ��� 1�G�L�L����4P� P�Q�Qrc�6�|jj�S)zlRetrieve a list of all name, entity pairs that I store references to.

        See getStaticEntity.
        )r&�itemsrs r
�listStaticEntitieszCollection.listStaticEntities�s��
�}�}�"�"�$�$rc��gS)zaA list of all name, entity that I can generate on demand.

        See getDynamicEntity.
        rrs  r
�listDynamicEntitieszCollection.listDynamicEntities��	��
�	rc�F�|j�|j|�zS)zURetrieve a list of all name, entity pairs I contain.

        See getEntity.
        )r@rBrs  r
�listEntitieszCollection.listEntities�s#��
�&�&�(�4�+C�+C�G�+L�L�Lrc�6�|jj�S)zkRetrieve a list of the names of entities that I store references to.

        See getStaticEntity.
        )r&�keysrs r
�listStaticNameszCollection.listStaticNames�s��
�}�}�!�!�#�#rc��gS)zlRetrieve a list of the names of entities that I store references to.

        See getDynamicEntity.
        rrs r
�listDynamicNameszCollection.listDynamicNames�rCrc�"�|j�S)zZRetrieve a list of all names for entities that I contain.

        See getEntity.
        )rHrs  r
�	listNameszCollection.listNames�s��
�#�#�%�%r�N)rrr	r
r'r,r/r2r6r8r;r=r@rBrErHrJrLrrr
r#r#>sP����'���"%� �Q�R�%��M�$��&rr#c��eZdZdZy)�ConstraintViolationz2An exception raised when a constraint is violated.Nrrrr
rOrO�s��<rrOc�(�eZdZdZd�Zd�Zd�Zd�Zy)�Constrainedz?A collection that has constraints on its names and/or entities.c��y)z�A method that determines whether an entity may be added to me with a given name.

        If the constraint is satisfied, return 1; if the constraint is not
        satisfied, either return 0 or raise a descriptive ConstraintViolation.
        �rr*s  r
�nameConstraintzConstrained.nameConstraint����rc��y)z�A method that determines whether an entity may be added to me.

        If the constraint is satisfied, return 1; if the constraint is not
        satisfied, either return 0 or raise a descriptive ConstraintViolation.
        rSr�rr5s  r
�entityConstraintzConstrained.entityConstraint�rUrc�2�tj|||�yrM)r#r6r4s   r
�reallyPutEntityzConstrained.reallyPutEntity�s�����T�4��0rc��|j|�r/|j|�r|j||�ytd��td��)zfStore an entity if it meets both constraints.

        Otherwise raise a ConstraintViolation.
        zEntity constraint violated.zName constraint violated.N)rTrXrZrOr4s   r
r6zConstrained.putEntity�sH��
���t�$��$�$�V�,��$�$�T�6�2�)�*G�H�H�%�&A�B�BrN)rrr	r
rTrXrZr6rrr
rQrQ�s��I���1�CrrQc� �eZdZdZdZd�Zd�Zy)�Lockedz5A collection that can be locked from adding entities.rc��d|_y)NrS��lockedrs r
�lockzLocked.lock�s	����rc��|jSrMr_rWs  r
rXzLocked.entityConstraint�s���;�;��rN)rrr	r
r`rarXrrr
r]r]�s��?�
�F��rr]c�&�eZdZdZeZd�Zd�Zd�Zy)�
Homogenousz�A homogenous collection of entities.

    I will only contain entities that are an instance of the class or type
    specified by my 'entityType' attribute.
    c�f�t||j�ryt|�d|j�d���)NrSz of incorrect type (�))�
isinstance�
entityTyperOrWs  r
rXzHomogenous.entityConstraint�s2���f�d�o�o�.��%���0D�T�_�_�DU�UV�&W�X�Xrc��y)N�Namerrs r
�getNameTypezHomogenous.getNameType�s��rc�.�|jjSrM)rhrrs r
�
getEntityTypezHomogenous.getEntityType�s�����'�'�'rN)	rrr	r
�objectrhrXrkrmrrr
rdrd�s����J�Y��(rrdN)
r
�twisted.pythonrrrrrr#�	ExceptionrOrQr]rdrrr
�<module>rqst��
�#��+��N�N�*N�N�&j&�j&�Z=�)�=�!C�*�!C�H	�[�	�(��(r

Zerion Mini Shell 1.0