
    vKg                         S SK r S SKrS SKrS SKJrJrJrJrJr   " S S\R                  5      r
 " S S\R                  5      rg)    N)connections
controller
exceptionsstateobjectversionc                   \    \ rS rSrSrSrSS\SS4S jjr\" \\	S9r
S	 rS
 r\S 5       rSrg)Error   a  
An Error.

This is distinct from an protocol error response (say, a HTTP code 500),
which is represented by a normal HTTPResponse object. This class is
responsible for indicating errors that fall outside of normal protocol
communications, like interrupted connections, timeouts, protocol errors.

Exposes the following attributes:

    msg: Message describing the error
    timestamp: Seconds since the epoch
zConnection killed.Nmsgreturnc                 V    Xl         U=(       d    [        R                  " 5       U l        g)z'
@type msg: str
@type timestamp: float
N)r   time	timestamp)selfr   r   s      f/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/seleniumwire/thirdparty/mitmproxy/flow.py__init__Error.__init__   s    
 "1diik    )r   r   c                     U R                   $ Nr   r   s    r   __str__Error.__str__&       xxr   c                     U R                   $ r   r   r   s    r   __repr__Error.__repr__)   r   r   c                 8    U " S 5      nUR                  U5        U$ r   	set_stateclsstatefs      r   
from_stateError.from_state,   s     I	Er   r   )__name__
__module____qualname____firstlineno____doc__KILLED_MESSAGEstrr   dictfloat_stateobject_attributesr   r   classmethodr&   __static_attributes__ r   r   r	   r	      sR     *N2C 2D 2 #
  r   r	   c                   f  ^  \ rS rSrSr SS\S\R                  S\R                  S\	SS4
S	 jjr
\" \\\R                  \R                  \\	\\	\R                  \\R                  4   S
9	rU 4S jrU 4S jr\S 5       rU 4S jrS rSS jrS r\S 5       rS rS rS r\S\4S j5       rSr U =r!$ )Flow5   z
A Flow is a collection of objects representing a single transaction.
This class is usually subclassed for each protocol, e.g. HTTPFlow.
Ntypeclient_connserver_connliver   c                     Xl         [        [        R                  " 5       5      U l        X l        X0l        X@l        S U l        SU l	        S U l
        S U l        SU l        S U l        [        5       U l        g NF)r8   r.   uuiduuid4idr9   r:   r;   errorintercepted_backupreplymarked	is_replayr/   metadata)r   r8   r9   r:   r;   s        r   r   Flow.__init__<   s`     	djjl#&&	-1
!&.28<
!/36:fr   )	r@   rA   r9   r:   r8   rB   rF   rE   rG   c                    > [         TU ]  5       nUR                  [        R                  S9  U R
                  (       a)  U R
                  U:w  a  UR                  U R
                  S9  U$ )N)r   )backup)super	get_stateupdater   FLOW_FORMAT_VERSIONrC   )r   d	__class__s     r   rL   Flow.get_state]   sM    G	445<<DLLA-HHDLLH)r   c                    > UR                  5       nUR                  S5        SU;   a  UR                  S5      U l        [        TU ]  U5        g )Nr   rJ   )copypoprC   rK   r!   )r   r$   rP   s     r   r!   Flow.set_stated   s?    

		)u 99X.DL% r   c                 :    U " S S 5      nUR                  U5        U$ r   r    r"   s      r   r&   Flow.from_statek   s    dO	Er   c                    > [         TU ]  5       nSUl        U R                  b  [        R
                  " 5       Ul        U$ r=   )rK   rS   r;   rD   r   
DummyReply)r   r%   rP   s     r   rS   	Flow.copyq   s4    GLN::! ++-AGr   c                 `    U R                   (       a  U R                   U R                  5       :g  $ g)z
Has this Flow been modified?
FrC   rL   r   s    r   modifiedFlow.modifiedx   s$     <<<<4>>#333r   c                 R    U R                   (       d  U R                  5       U l         gg)zQ
Save a backup of this Flow, which can be reverted to using a
call to .revert().
Nr\   )r   forces     r   rJ   Flow.backup   s    
 ||>>+DL r   c                 l    U R                   (       a#  U R                  U R                   5        SU l         gg)z%
Revert to the last backed up state.
N)rC   r!   r   s    r   revertFlow.revert   s'     <<NN4<<(DL r   c                     U R                   =(       aG    U R                   R                  S;   =(       a'    U R                   R                  [        R                  :g  $ )N>   starttaken)rD   r$   valuer   Killr   s    r   killableFlow.killable   sC     JJ 0JJ 220JJ
/	
r   c                     [        [         R                  5      U l        SU l        U R                  R                  SS9  SU l        g)z
Kill this request.
FT)r`   N)r	   r-   rA   rB   rD   killr;   r   s    r   rm   	Flow.kill   s7     5//0
 

d#	r   c                 j    U R                   (       a  gSU l         U R                  R                  5         g)zC
Intercept this Flow. Processing will stop until resume is
called.
NT)rB   rD   taker   s    r   	interceptFlow.intercept   s&    
 

r   c                     U R                   (       d  gSU l         U R                  R                  S:X  a5  U R                  R                  5         U R                  R	                  5         gg)z7
Continue with the flow - called after an intercept().
NFrg   )rB   rD   r$   ackcommitr   s    r   resumeFlow.resume   sM      ::w&JJNNJJ 'r   c                 .    U R                   R                  $ )zStart time of the flow.)r9   timestamp_startr   s    r   ry   Flow.timestamp_start   s     ///r   )rC   r9   rA   r@   rB   rF   r;   rE   rG   rD   r:   r8   r   )F)"r(   r)   r*   r+   r,   r.   r   ClientConnectionServerConnectionboolr   r/   r	   typingDictAnyr1   rL   r!   r2   r&   rS   r]   rJ   rc   propertyrj   rm   rq   rv   r0   ry   r3   __classcell__)rP   s   @r   r6   r6   5   s    == %55= %55	=
 = 
=* #0000S&**_-
!  
,  
 

  0 0 0r   r6   )r   r~   r>   !seleniumwire.thirdparty.mitmproxyr   r   r   r   r   StateObjectr	   r6   r4   r   r   <module>r      s;       g g*K## *ZF0;"" F0r   