CasperSecurity

Current Path : /usr/lib/python3/dist-packages/twisted/python/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/twisted/python/__pycache__/roots.cpython-310.pyc

o

�b
�@s�dZddlmZGdd�de�ZGdd�d�ZGdd�d�ZGd	d
�d
�ZGdd�de�Z	Gd
d�de�Z
Gdd�de
�ZGdd�de
�ZdS)zf
Twisted Python Roots: an abstract hierarchy representation for Twisted.

Maintainer: Glyph Lefkowitz
�)�reflectc@�eZdZdZdS)�NotSupportedErrorzv
    An exception meaning that the tree-manipulation operation
    you're attempting to perform is not supported.
    N��__name__�
__module__�__qualname__�__doc__�r
r
�6/usr/lib/python3/dist-packages/twisted/python/roots.pyr�rc@s$eZdZdZdZdd�Zdd�ZdS)�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().
    NcC�tdt�|j���)z.Add some data to the response to this request.z%s.write��NotImplementedErrorr�qual�	__class__)�self�datar
r
r�write"�z
Request.writecCr)zOThe response to this request is finished; flush all data to the network stream.z	%s.finishr�rr
r
r�finish&rzRequest.finish)rrrr	�wireProtocolrrr
r
r
rr
s
	r
c@seZdZdZdd�ZdS)�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.
    cCr)zw
        I produce a stream of bytes for the request, by calling request.write()
        and request.finish().
        z	%s.renderr�r�requestr
r
r�render6sz
Entity.renderN)rrrr	rr
r
r
rr+s
rc@s�eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) �
Collectionz�I represent a static collection of entities.

    I contain methods designed to represent collections that can be dynamically
    created.
    NcCs|dur	||_dSi|_dS)zInitialize me.N��entities)rr r
r
r�__init__Es

zCollection.__init__cCs|j�|�S)zqGet an entity that was added to me using putEntity.

        This method will return 'None' if it fails.
        )r �get�r�namer
r
r�getStaticEntityL�zCollection.getStaticEntitycC�dS)znSubclass this to generate an entity on demand.

        This method should return 'None' if it fails.
        Nr
�rr$rr
r
r�getDynamicEntitySszCollection.getDynamicEntitycCs2|�|�}|dur|S|�||�}|dur|SdS)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�entr
r
r�	getEntityYs
	zCollection.getEntitycCs||j|<dS)zlStore a static reference on 'name' for 'entity'.

        Raises a KeyError if the operation fails.
        Nr�rr$�entityr
r
r�	putEntityjszCollection.putEntitycCs|j|=dS)zaRemove a static reference for 'name'.

        Raises a KeyError if the operation fails.
        Nrr#r
r
r�	delEntityqr&zCollection.delEntitycCr)z>Store an entity for 'name', based on the content of 'request'.z%s.storeEntity�rrrrr(r
r
r�storeEntityxrzCollection.storeEntitycCr)z?Remove an entity for 'name', based on the content of 'request'.z%s.removeEntityr0r(r
r
r�removeEntity|rzCollection.removeEntitycC�
|j��S)zlRetrieve a list of all name, entity pairs that I store references to.

        See getStaticEntity.
        )r �itemsrr
r
r�listStaticEntities��
zCollection.listStaticEntitiescC�gS)zaA list of all name, entity that I can generate on demand.

        See getDynamicEntity.
        r
rr
r
r�listDynamicEntities��zCollection.listDynamicEntitiescCs|��|�|�S)zURetrieve a list of all name, entity pairs I contain.

        See getEntity.
        )r5r8rr
r
r�listEntities�szCollection.listEntitiescCr3)zkRetrieve a list of the names of entities that I store references to.

        See getStaticEntity.
        )r �keysrr
r
r�listStaticNames�r6zCollection.listStaticNamescCr7)zlRetrieve a list of the names of entities that I store references to.

        See getDynamicEntity.
        r
rr
r
r�listDynamicNames�r9zCollection.listDynamicNamescCs|��S)zZRetrieve a list of all names for entities that I contain.

        See getEntity.
        )r<rr
r
r�	listNames�szCollection.listNames�N)rrrr	r!r%r)r+r.r/r1r2r5r8r:r<r=r>r
r
r
rr>s 
rc@r)�ConstraintViolationz2An exception raised when a constraint is violated.Nrr
r
r
rr@�rr@c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Constrainedz?A collection that has constraints on its names and/or entities.cCr')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.
        �r
r#r
r
r�nameConstraint��zConstrained.nameConstraintcCr')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.
        rBr
�rr-r
r
r�entityConstraint�rDzConstrained.entityConstraintcCst�|||�dSr?)rr.r,r
r
r�reallyPutEntity�szConstrained.reallyPutEntitycCs4|�|�r|�|�r|�||�dStd��td��)zfStore an entity if it meets both constraints.

        Otherwise raise a ConstraintViolation.
        zEntity constraint violated.zName constraint violated.N)rCrFrGr@r,r
r
rr.�s


zConstrained.putEntityN)rrrr	rCrFrGr.r
r
r
rrA�srAc@s$eZdZdZdZdd�Zdd�ZdS)�Lockedz5A collection that can be locked from adding entities.rcCs
d|_dS)NrB��lockedrr
r
r�lock�s
zLocked.lockcCs|jSr?rIrEr
r
rrF��zLocked.entityConstraintN)rrrr	rJrKrFr
r
r
rrH�s
rHc@s,eZdZdZeZdd�Zdd�Zdd�ZdS)	�
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.
    cCs&t||j�rdSt|�d|j�d���)NrBz of incorrect type (�))�
isinstance�
entityTyper@rEr
r
rrF�szHomogenous.entityConstraintcCr')N�Namer
rr
r
r�getNameType�szHomogenous.getNameTypecCs|jjSr?)rPrrr
r
r�
getEntityType�rLzHomogenous.getEntityTypeN)	rrrr	�objectrPrFrRrSr
r
r
rrM�srMN)
r	�twisted.pythonrrrr
rr�	Exceptionr@rArHrMr
r
r
r�<module>sm$
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY