U
    fY0                  o  @   sb  d Z ddlZdddgZG dd deZzddlmZ dd	 ZW n ek
rL   dZ	d
Z
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
dddddd
d
d
ddd
d
d
d
d
d
d
d
d
d
d
d
d
dd
d
d
d
d
dd
dd
d
d
dd
d
d
d
d
dd
dd
d
d
d
d
d
d
d
d
dd
d
d
d
d
dd
d
d
d
d
d
d
dd
d
d
d
d
d
d
d
d
dd
dd
d
d
dd
d
d
d
d
dd
dd
d
d
dd
d
d
d
d
d
d
d
d
d
glZdd Zdd	 ZY nX d d Zd!d ZdS )"aK  
websocket - WebSocket client library for Python

Copyright (C) 2010 Hiroki Ohtani(liris)

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1335  USA

    NNoLockvalidate_utf8extract_err_messagec                   @   s   e Zd Zdd Zdd ZdS )r   c                 C   s   d S N )selfr   r   2/usr/lib/python3/dist-packages/websocket/_utils.py	__enter__   s    zNoLock.__enter__c                 C   s   d S r   r   )r   exc_type	exc_value	tracebackr   r   r   __exit__    s    zNoLock.__exit__N)__name__
__module____qualname__r	   r   r   r   r   r   r      s   )Utf8Validatorc                 C   s   t  | d S Nr   )r   Zvalidateutfbytesr   r   r   _validate_utf8(   s    r         	            
                     $   <   `   T   0   H   c                 C   sD   t | }| tkr |d@ |d> B n
d|? |@ }t d|  |  } | |fS )N?   r          )_UTF8D_UTF8_ACCEPT)statecodepZchtpr   r   r   _decodeF   s    
r1   c                 C   sB   t }d}| D ]0}tjrt|}t|||\}}|tkr dS qdS )Nr   FT)r-   sixZPY2ordr1   _UTF8_REJECT)r   r.   r/   ir   r   r   r   O   s    c                 C   s   t | S )z
    validate utf8 byte string.
    utfbytes: utf byte string to check.
    return value: if valid utf8 string, return true. Otherwise, return false.
    )r   r   r   r   r   r   \   s    c                 C   s   | j r| j d S d S d S r   )args)Z	exceptionr   r   r   r   e   s    
)__doc__r2   __all__objectr   Zwsaccel.utf8validatorr   r   ImportErrorr-   r4   r,   r1   r   r   r   r   r   r   <module>   s  
                                                                                                                                                                                                                                                                                                                                                               		