
    9h                     z    S SK r SSKJr  SSKJrJrJr  SSKJ	r	   " S S\5      r
 " S S	\5      r " S
 S\5      rg)    N   )datastructures)InvalidHandshakeInvalidMessageProtocolError)
StatusLikec                   P    \ rS rSrSrS\S\R                  SS4S jrS\	4S jr
S	rg)
InvalidStatusCode   z;
Raised when a handshake response status code is invalid.

status_codeheadersreturnNc                     Xl         X l        g N)r   r   )selfr   r   s      aC:\Suresh\moveshuttle\MDcreated\moveengine\venv\Lib\site-packages\websockets/legacy/exceptions.py__init__InvalidStatusCode.__init__   s    &    c                      SU R                    3$ )Nz+server rejected WebSocket connection: HTTP )r   r   s    r   __str__InvalidStatusCode.__str__   s    <T=M=M<NOOr   )r   r   )__name__
__module____qualname____firstlineno____doc__intr   Headersr   strr   __static_attributes__ r   r   r
   r
      s5    
C .2H2H T P Pr   r
   c            	       Z    \ rS rSrSr SS\S\R                  S\SS4S jjr	S\
4S	 jrS
rg)AbortHandshake   ad  
Raised to abort the handshake on purpose and return an HTTP response.

This exception is an implementation detail.

The public API is
:meth:`~websockets.legacy.server.WebSocketServerProtocol.process_request`.

Attributes:
    status (~http.HTTPStatus): HTTP status code.
    headers (Headers): HTTP response headers.
    body (bytes): HTTP response body.
statusr   bodyr   Nc                 |    [         R                  " U5      U l        [        R                  " U5      U l        X0l        g r   )http
HTTPStatusr'   r   r    r   r(   )r   r'   r   r(   s       r   r   AbortHandshake.__init__*   s+     oof-%--g6	r   c                 |    SU R                   S S[        U R                  5       S[        U R                  5       S3$ )NzHTTP dz, z
 headers, z bytes)r'   lenr   r(   r   s    r   r   AbortHandshake.__str__5   s9    DKK?"S%6$7z#dii.AQQWX	
r   )r(   r   r'   )r   )r   r   r   r   r   r   r   HeadersLikebytesr   r!   r   r"   r#   r   r   r%   r%      sI    $ 			  ++	 		
 
	
 
r   r%   c                   8    \ rS rSrSrS\SS4S jrS\4S jrSrg)	RedirectHandshake;   zX
Raised when a handshake gets redirected.

This exception is an implementation detail.

urir   Nc                     Xl         g r   r6   )r   r6   s     r   r   RedirectHandshake.__init__C   s    r   c                      SU R                    3$ )Nzredirect to r8   r   s    r   r   RedirectHandshake.__str__F   s    dhhZ((r   r8   )	r   r   r   r   r   r!   r   r   r"   r#   r   r   r4   r4   ;   s&    C D ) )r   r4   )r*    r   
exceptionsr   r   r   WebSocketProtocolErrortypingr   r
   r%   r4   r#   r   r   <module>r@      sD        P( P
% 
@)( )r   