+
    Dfj
                         R t ^ RIHt  ! R R]4      t ! R R4      t ! R R4      t ! R R	4      t ! R
 R]4      t	 ! R R]4      t
 ! R R]
4      t ! R R]
4      tR# )zf
Twisted Python Roots: an abstract hierarchy representation for Twisted.

Maintainer: Glyph Lefkowitz
)reflectc                       ] tR t^tRtRtR# )NotSupportedErrorzj
An exception meaning that the tree-manipulation operation
you're attempting to perform is not supported.
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       6/usr/lib/python3/dist-packages/twisted/python/roots.pyr   r      s    r   r   c                   4   a  ] tR t^t o RtRtR tR tRtV t	R# )RequestzI 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                b    \        R\        P                  ! V P                  4      ,          4      h)z.Add some data to the response to this request.z%s.writeNotImplementedErrorr   qual	__class__)selfdatas   &&r   writeRequest.write"   s    !*w||DNN/K"KLLr   c                b    \        R\        P                  ! V P                  4      ,          4      h)zOThe response to this request is finished; flush all data to the network stream.z	%s.finishr   r   s   &r   finishRequest.finish&   s    !+T^^0L"LMMr   r   )
r   r   r	   r
   r   wireProtocolr   r   r   __classdictcell____classdict__s   @r   r   r      s#      LMN Nr   r   c                   *   a  ] tR t^+t o RtR tRtV tR# )EntityaB  I 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                b    \        R\        P                  ! V P                  4      ,          4      h)z_
I produce a stream of bytes for the request, by calling request.write()
and request.finish().
z	%s.renderr   r   requests   &&r   renderEntity.render6   s!    
 "+T^^0L"LMMr   r   N)r   r   r	   r
   r   r'   r   r   r    s   @r   r#   r#   +   s     N Nr   r#   c                   |   a  ] tR t^>t o RtRR ltR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tRtV tR# )
CollectionzI represent a static collection of entities.

I contain methods designed to represent collections that can be dynamically
created.
Nc                ,    Ve	   Wn         R# / V n         R# )zInitialize me.Nentities)r   r-   s   &&r   __init__Collection.__init__E   s    $MDMr   c                8    V P                   P                  V4      # )zaGet an entity that was added to me using putEntity.

This method will return 'None' if it fails.
)r-   getr   names   &&r   getStaticEntityCollection.getStaticEntityL   s    
 }}  &&r   c                    R# )z^Subclass this to generate an entity on demand.

This method should return 'None' if it fails.
Nr   r   r3   r&   s   &&&r   getDynamicEntityCollection.getDynamicEntityS   s    r   c                b    V P                  V4      pVe   V# V P                  W4      pVe   V# R# )zRetrieve 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)r4   r8   )r   r3   r&   ents   &&& r   	getEntityCollection.getEntityY   s;     ""4(?J##D2?Jr   c                "    W P                   V&   R# )z\Store a static reference on 'name' for 'entity'.

Raises a KeyError if the operation fails.
Nr,   r   r3   entitys   &&&r   	putEntityCollection.putEntityj   s    
 %dr   c                     V P                   V R# )zQRemove a static reference for 'name'.

Raises a KeyError if the operation fails.
Nr,   r2   s   &&r   	delEntityCollection.delEntityq   s    
 MM$r   c                b    \        R\        P                  ! V P                  4      ,          4      h)z>Store an entity for 'name', based on the content of 'request'.z%s.storeEntityr   r   r   r   r7   s   &&&r   storeEntityCollection.storeEntityx   s      07<<3O OPPr   c                b    \        R\        P                  ! V P                  4      ,          4      h)z?Remove an entity for 'name', based on the content of 'request'.z%s.removeEntityrG   r7   s   &&&r   removeEntityCollection.removeEntity|   s      1GLL4P PQQr   c                6    V P                   P                  4       # )z\Retrieve a list of all name, entity pairs that I store references to.

See getStaticEntity.
)r-   itemsr   s   &r   listStaticEntitiesCollection.listStaticEntities   s    
 }}""$$r   c                    . # )zQA list of all name, entity that I can generate on demand.

See getDynamicEntity.
r   r%   s   &&r   listDynamicEntitiesCollection.listDynamicEntities   	    
 	r   c                N    V P                  4       V P                  V4      ,           # )zERetrieve a list of all name, entity pairs I contain.

See getEntity.
)rO   rR   r%   s   &&r   listEntitiesCollection.listEntities   s#    
 &&(4+C+CG+LLLr   c                6    V P                   P                  4       # )z[Retrieve a list of the names of entities that I store references to.

See getStaticEntity.
)r-   keysr   s   &r   listStaticNamesCollection.listStaticNames   s    
 }}!!##r   c                    . # )z\Retrieve a list of the names of entities that I store references to.

See getDynamicEntity.
r   r   s   &r   listDynamicNamesCollection.listDynamicNames   rT   r   c                "    V P                  4       # )zJRetrieve a list of all names for entities that I contain.

See getEntity.
)rZ   r%   s   &&r   	listNamesCollection.listNames   s    
 ##%%r   r,   N)r   r   r	   r
   r   r.   r4   r8   r<   rA   rD   rH   rK   rO   rR   rV   rZ   r]   r`   r   r   r    s   @r   r*   r*   >   sX     '"% QR%M$& &r   r*   c                       ] tR t^tRtRtR# )ConstraintViolationz2An exception raised when a constraint is violated.r   Nr   r   r   r   rd   rd      s    <r   rd   c                   <   a  ] tR t^t o RtR tR tR tR tRt	V t
R# )Constrainedz?A collection that has constraints on its names and/or entities.c                    ^# )zA 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   r2   s   &&r   nameConstraintConstrained.nameConstraint        r   c                    ^# )zA 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.
r   r   r@   s   &&r   entityConstraintConstrained.entityConstraint   rj   r   c                2    \         P                  WV4       R # rb   )r*   rA   r?   s   &&&r   reallyPutEntityConstrained.reallyPutEntity   s    T0r   c                    V P                  V4      '       d6   V P                  V4      '       d   V P                  W4       R# \        R4      h\        R4      h)zVStore an entity if it meets both constraints.

Otherwise raise a ConstraintViolation.
zEntity constraint violated.zName constraint violated.N)rh   rm   rp   rd   r?   s   &&&r   rA   Constrained.putEntity   sL    
 t$$$$V,,$$T2)*GHH%&ABBr   r   N)r   r   r	   r
   r   rh   rm   rp   rA   r   r   r    s   @r   rf   rf      s#     I1C Cr   rf   c                   4   a  ] tR t^t o Rt^ tR tR tRtV t	R# )Lockedz5A collection that can be locked from adding entities.c                    ^V n         R# )   Nlockedr   s   &r   lockLocked.lock   s	    r   c                $    V P                   '       * # rb   rx   rl   s   &&r   rm   Locked.entityConstraint   s    ;;r   rx   N)
r   r   r	   r
   r   ry   rz   rm   r   r   r    s   @r   ru   ru      s     ?F r   ru   c                   :   a  ] tR t^t o Rt]tR tR tR t	Rt
V tR# )
HomogenouszA homogenous collection of entities.

I will only contain entities that are an instance of the class or type
specified by my 'entityType' attribute.
c                r    \        WP                  4      '       d   ^# \        V RV P                   R24      h)rw   z of incorrect type ())
isinstance
entityTyperd   rl   s   &&r   rm   Homogenous.entityConstraint   s3    foo..%0DT__DUUV&WXXr   c                    R # )Namer   r   s   &r   getNameTypeHomogenous.getNameType   s    r   c                .    V P                   P                  # rb   )r   r   r   s   &r   getEntityTypeHomogenous.getEntityType   s    '''r   r   N)r   r   r	   r
   r   objectr   rm   r   r   r   r   r    s   @r   r   r      s&      JY( (r   r   N)r   twisted.pythonr   r   r   r   r#   r*   	Exceptionrd   rf   ru   r   r   r   r   <module>r      st   
 #+ N N*N N&j& j&Z=) =!C* !CH	[ 	( (r   