
    hx                         S SK r S SKJrJrJrJr  Sr " S S\5      r " S S\R                  5      r
S r " S	 S
\5      rg)    N)jsonlog	messagingutil<   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )ComponentNotAvailable   c                 >   > [         TU ]  UR                   S35        g )Nz is not available)super__init____name__)selftype	__class__s     mC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\debugpy/adapter/components.pyr   ComponentNotAvailable.__init__   s    DMM?*;<=     )r   
__module____qualname____firstlineno__r   __static_attributes____classcell__r   s   @r   r	   r	      s    > >r   r	   c                      ^  \ rS rSrSrSU 4S jjrS r\S 5       r\S 5       r	\S 5       r
S r\S	 5       rS
 rSrU =r$ )	Component   a  A component managed by a debug adapter: client, launcher, or debug server.

Every component belongs to a Session, which is used for synchronization and
shared data.

Every component has its own message channel, and provides message handlers for
that channel. All handlers should be decorated with @Component.message_handler,
which ensures that Session is locked for the duration of the handler. Thus, only
one handler is running at any given time across all components, unless the lock
is released explicitly or via Session.wait_for().

Components report changes to their attributes to Session, allowing one component
to wait_for() a change caused by another component.
c                 ,  >^  US L US L -  (       d   e UR                   R                  SS9nU(       d   S5       e UR                   R                  5         [        TT ]  5         UT l        Uc8  [        T 5      Ul        [        R                  " UT 5      nUR                  5         O([        T 5      =Ul        UR                  l        T Ul        UT l        ST l        T =R                  U 4S j/-  sl        g ! UR                   R                  5         f = f)NF)blockingz6__init__ of a Component subclass must lock its SessionTc                  8   > TR                   R                  5       $ N)sessionnotify_changed)_r   s    r   <lambda>$Component.__init__.<locals>.<lambda>:   s    dll&A&A&Cr   )lockacquirereleaser   r   r#   strnamer   JsonMessageChannelstartstreamhandlerschannelis_connected	observers)r   r#   r/   r1   	lock_heldr   s   `    r   r   Component.__init__"   s    $7d?333	#,,e,<IVVV9LL  "?d)FK2264@GMMO14T:GL7>>.#G  	CDD# LL  "s   'C7 7Dc                 `    [        U 5      R                   SU R                  R                   S3$ )N[])r   r   r#   idr   s    r   __str__Component.__str__<   s)    t*%%&a'8::r   c                 .    U R                   R                  $ r"   )r#   clientr:   s    r   r>   Component.client?       ||"""r   c                 .    U R                   R                  $ r"   )r#   launcherr:   s    r   rB   Component.launcherC   s    ||$$$r   c                 .    U R                   R                  $ r"   )r#   serverr:   s    r   rE   Component.serverG   r@   r   c                 :    U R                   R                  " U0 UD6$ r"   )r#   wait_for)r   argskwargss      r   rH   Component.wait_forK   s    ||$$d5f55r   c                 F   ^  [         R                  " T 5      U 4S j5       nU$ )zApplied to a message handler to automatically lock and unlock the session
for its duration, and to validate the session state.

If the handler raises ComponentNotAvailable or JsonIOError, converts it to
Message.cant_handle().
c                   >  U R                      T" X5      sS S S 5        $ ! , (       d  f       g = f! [         a  nUR                  SUSS9eS nAf[        R                   a+  nUR
                  UL a  e UR                  U5         S nAg S nAf[        R                   a*  nUR                  SUR                  R                  SS9eS nAff = f)N{0}T)silentz{0} disconnected unexpectedly)
r#   r	   cant_handler   MessageHandlingErrorcause	propagateJsonIOErrorr/   r,   )r   messageexcfs      r   lock_and_handle2Component.message_handler.<locals>.lock_and_handleW   s    \\T+ "\\( C))%T)BB11 +99'MM'**(( ))3SZZ__T *  s@   2 !	2 
/2 2 
CAC$!B

C!%CC)	functoolswraps)rW   rX   s   ` r   message_handlerComponent.message_handlerN   s(     
		 
	  r   c                     U R                      SU l        U R                   R                  SR                  U 5      5        S S S 5        g ! , (       d  f       g = f)NFz{0} has disconnected)r#   r2   finalizeformatr:   s    r   
disconnectComponent.disconnectj   s9    \\ %DLL!!"8"?"?"EF \\s   2A
A)r1   r2   r#   )NN)r   r   r   r   __doc__r   r;   propertyr>   rB   rE   rH   staticmethodr\   ra   r   r   r   s   @r   r   r      st    E4; # # % % # #6  6G Gr   r   c                 H   ^ ^^  " U4S jS[         5      nU U4S jmU" 5       $ )Nc                   4   > \ rS rSrSrU 4S j=rrS =rrSr	g)missing.<locals>.Missingq   z_A dummy component that raises ComponentNotAvailable whenever some
attribute is accessed on it.
c                    > T" 5       $ r"   r   )r   r%   reports     r   r&   !missing.<locals>.Missing.<lambda>v   s    VXr   c                     g)NFr   r:   s    r   r&   rl   w   s    er   r   N)
r   r   r   r   rc   __getattr____setattr____bool____nonzero__r   )rk   s   r   Missingrh   q   s    	 %>=k!33;r   rr   c                  z   >  [        T5      e! [         a"  n [        R                  " SU T5         S n A g S n A ff = f)Nz
{0} in {1})r	   	Exceptionr   reraise_exception)rV   r#   r   s    r   rk   missing.<locals>.reporty   s8    	>'-- 	>!!,W==	>s    
:5:)object)r#   r   rr   rk   s   `` @r   missingrx   p   s    4& 4> 9r   c                   0    \ rS rSrSr0 r S rS rS rSr	g)Capabilities   zA collection of feature flags for a component. Corresponds to JSON properties
in the DAP "initialize" request or response, other than those that identify the
party.
c                    UR                  S5      (       d  UR                  S5      (       d   eXl        UR                  nU R                  R                  5        HZ  u  pEUR                  US5      n[        U5      (       d  [        R                  " U5      n U" U5      nUS:w  d
   U S35       eX`U'   M\     [        R                  " SU 5        g! [         a,  nUR                  S[        R                  " U5      U5      eSnAff = f)zParses an "initialize" request or response and extracts the feature flags.

For every "X" in self.PROPERTIES, sets self["X"] to the corresponding value
from message.payload if it's present there, or to the default value otherwise.

initializer   z{0} {1}Nz5 must provide a default value for missing properties.rN   )
is_requestis_response	componentpayload
PROPERTIESitemsgetcallabler   defaultrt   
isnt_validreprr   debug)r   r   rU   r   r,   validatevaluerV   s           r   r   Capabilities.__init__   s     !!,//73F3F|3T3TTT"//"oo335NDKKb)EH%%<<1J 
 RPQRJ 6 			%  J((DIIdOSIIJs   C
D'DDc                 p    [        U 5      R                   S[        R                  " [	        U 5      5       3$ )Nz: )r   r   r   r   dictr:   s    r   __repr__Capabilities.__repr__   s,    t*%%&b4:)>(?@@r   c                     U HE  nX   (       a  M  [         R                  " U R                   S[        R                  " U5       35      e   g )Nz does not have capability )r   rQ   r   r   r   )r   keyskeys      r   requireCapabilities.require   sC    C9944~~&&@3@PQ  r   )r   N)
r   r   r   r   rc   r   r   r   r   r   r   r   r   rz   rz      s#    
 J:Ar   rz   )rZ   debugpy.commonr   r   r   r   ACCEPT_CONNECTIONS_TIMEOUTrt   r	   
Observabler   rx   r   rz   r   r   r   <module>r      sJ   
  5 5   >I >
[G [G|$54 5r   