ó
    Ö›‘h
  ã                   ó¾   • S r SSKJr   " S S\5      r " S S5      r " S S5      r " S	 S
5      r " S S\5      r	 " S S\5      r
 " S S\
5      r " S S\
5      rg)zf
Twisted Python Roots: an abstract hierarchy representation for Twisted.

Maintainer: Glyph Lefkowitz
é    )Úreflectc                   ó   • \ rS rSrSrSrg)ÚNotSupportedErroré   zj
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   ó    ÚXC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/python/roots.pyr   r      s   † ôr   r   c                   ó(   • \ rS rSrSrSrS rS rSrg)ÚRequesté   zÓ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                 óZ   • [        S[        R                  " U R                  5      -  5      e)z.Add some data to the response to this request.z%s.write©ÚNotImplementedErrorr   ÚqualÚ	__class__)ÚselfÚdatas     r   ÚwriteÚRequest.write"   s   € ä! *¬w¯|ª|¸D¿N¹NÓ/KÑ"KÓLÐLr   c                 óZ   • [        S[        R                  " U R                  5      -  5      e)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   r   r   r   r   r      s   † ñð €LòMõNr   r   c                   ó   • \ rS rSrSrS rSrg)ÚEntityé+   aB  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                 óZ   • [        S[        R                  " U R                  5      -  5      e)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   r   r#   r#   +   s   † ñõNr   r#   c                   óp   • \ rS rSrSrSS jrS rS rS rS r	S	 r
S
 rS rS rS rS rS rS rS rSrg)Ú
Collectioné>   zƒI represent a static collection of entities.

I contain methods designed to represent collections that can be dynamically
created.
Nc                 ó&   • Ub  Xl         g0 U l         g)zInitialize me.N©Úentities)r   r/   s     r   Ú__init__ÚCollection.__init__E   s   € àÑØ$�MàˆD�Mr   c                 ó8   • U R                   R                  U5      $ )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                 ó   • g)z^Subclass this to generate an entity on demand.

This method should return 'None' if it fails.
Nr   ©r   r5   r'   s      r   ÚgetDynamicEntityÚCollection.getDynamicEntityS   s   � r   c                 ó\   • U R                  U5      nUb  U$ U R                  X5      nUb  U$ g)zîRetrieve 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)r6   r:   )r   r5   r'   Úents       r   Ú	getEntityÚCollection.getEntityY   s;   € ð ×"Ñ" 4Ó(ˆØ‰?ØˆJØ×#Ñ# DÓ2ˆØ‰?ØˆJØr   c                 ó    • X R                   U'   g)z\Store a static reference on 'name' for 'entity'.

Raises a KeyError if the operation fails.
Nr.   ©r   r5   Úentitys      r   Ú	putEntityÚCollection.putEntityj   s   € ð
 %�‰�dÒr   c                 ó   • U R                   U	 g)zQRemove a static reference for 'name'.

Raises a KeyError if the operation fails.
Nr.   r4   s     r   Ú	delEntityÚCollection.delEntityq   s   € ð
 �M‰M˜$Ñr   c                 óZ   • [        S[        R                  " U R                  5      -  5      e)z>Store an entity for 'name', based on the content of 'request'.z%s.storeEntity©r   r   r   r   r9   s      r   ÚstoreEntityÚCollection.storeEntityx   s    € äÐ 0´7·<²<ÀÇÁÓ3OÑ OÓPÐPr   c                 óZ   • [        S[        R                  " U R                  5      -  5      e)z?Remove an entity for 'name', based on the content of 'request'.z%s.removeEntityrI   r9   s      r   ÚremoveEntityÚCollection.removeEntity|   s    € äÐ 1´G·L²LÀÇÁÓ4PÑ PÓQÐQr   c                 ó6   • U R                   R                  5       $ )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                 óF   • U R                  5       U R                  U5      -   $ )zERetrieve a list of all name, entity pairs I contain.

See getEntity.
)rQ   rT   r&   s     r   ÚlistEntitiesÚCollection.listEntitiesŽ   s#   € ð
 ×&Ñ&Ó(¨4×+CÑ+CÀGÓ+LÑLÐLr   c                 ó6   • U R                   R                  5       $ )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œ   rV   r   c                 ó"   • U R                  5       $ )zJRetrieve a list of all names for entities that I contain.

See getEntity.
)r\   r&   s     r   Ú	listNamesÚCollection.listNames£   s   € ð
 ×#Ñ#Ó%Ð%r   r.   ©N)r	   r
   r   r   r   r0   r6   r:   r>   rC   rF   rJ   rM   rQ   rT   rX   r\   r_   rb   r   r   r   r   r+   r+   >   sP   † ñôò'òòò"%ò òQòRò%òòMò$òõ&r   r+   c                   ó   • \ rS rSrSrSrg)ÚConstraintViolationé«   z2An exception raised when a constraint is violated.r   Nr   r   r   r   rf   rf   «   s   † Ü<r   rf   c                   ó0   • \ rS rSrSrS rS rS rS rSr	g)	ÚConstrainedé¯   z?A collection that has constraints on its names and/or entities.c                 ó   • g)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   r4   s     r   ÚnameConstraintÚConstrained.nameConstraint²   ó   € ð r   c                 ó   • g)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.
rl   r   ©r   rB   s     r   ÚentityConstraintÚConstrained.entityConstraintº   ro   r   c                 ó0   • [         R                  XU5        g rd   )r+   rC   rA   s      r   ÚreallyPutEntityÚConstrained.reallyPutEntityÂ   s   € Ü×Ñ˜T¨Õ0r   c                 óª   • U R                  U5      (       a3  U R                  U5      (       a  U R                  X5        g[        S5      e[        S5      e)zVStore an entity if it meets both constraints.

Otherwise raise a ConstraintViolation.
zEntity constraint violated.zName constraint violated.N)rm   rr   ru   rf   rA   s      r   rC   ÚConstrained.putEntityÅ   sL   € ð
 ×Ñ˜t×$Ñ$Ø×$Ñ$ V×,Ñ,Ø×$Ñ$ TÕ2ä)Ð*GÓHÐHä%Ð&AÓBÐBr   r   N)
r	   r
   r   r   r   rm   rr   ru   rC   r   r   r   r   ri   ri   ¯   s   † ÙIòòò1õCr   ri   c                   ó(   • \ rS rSrSrSrS rS rSrg)ÚLockedéÓ   z5A collection that can be locked from adding entities.r   c                 ó   • SU l         g )Nrl   ©Úlockedr   s    r   ÚlockÚLocked.lockØ   s	   € Øˆ�r   c                 ó$   • U R                   (       + $ rd   r}   rq   s     r   rr   ÚLocked.entityConstraintÛ   s   € Ø—;‘;ŒÐr   r}   N)	r	   r
   r   r   r   r~   r   rr   r   r   r   r   rz   rz   Ó   s   † Ù?à€Fòõr   rz   c                   ó.   • \ rS rSrSr\rS rS rS r	Sr
g)Ú
Homogenouséß   z•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                 ón   • [        XR                  5      (       a  g[        U SU R                   S35      e)Nrl   z of incorrect type (Ú))Ú
isinstanceÚ
entityTyperf   rq   s     r   rr   ÚHomogenous.entityConstraintè   s3   € Ü�fŸo™o×.Ñ.Øä%¨¨Ð0DÀTÇ_Á_ÐDUÐUVÐ&WÓXÐXr   c                 ó   • g)NÚNamer   r   s    r   ÚgetNameTypeÚHomogenous.getNameTypeî   s   € Ør   c                 ó.   • U R                   R                  $ rd   )r‰   r	   r   s    r   ÚgetEntityTypeÚHomogenous.getEntityTypeñ   s   € Ø�‰×'Ñ'Ð'r   r   N)r	   r
   r   r   r   Úobjectr‰   rr   r�   r�   r   r   r   r   r„   r„   ß   s   † ñð €JòYòõ(r   r„   N)r   Útwisted.pythonr   r   r   r   r#   r+   Ú	Exceptionrf   ri   rz   r„   r   r   r   Ú<module>r•      st   ðñ
õ #ôÐ+ô ÷Nñ N÷*Nñ N÷&j&ñ j&ôZ=˜)ô =ô!C�*ô !CôH	ˆ[ô 	ô(�õ (r   