o
    ¾À•aO  ã                   @   s    d Z 	 ddlZG dd„ dƒZdS )z

é    Nc                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚSimpleCookieJarc                 C   s   t ƒ | _d S )N)ÚdictÚjar)Úself© r   ú6/usr/lib/python3/dist-packages/websocket/_cookiejar.pyÚ__init__   s   zSimpleCookieJar.__init__c                 C   s„   |r>t j |¡}| ¡ D ]3\}}| d¡}|r=| d¡s d| }| j |¡r,| j |¡nt j ¡ }| |¡ || j| ¡ < qd S d S ©NÚdomainÚ.)	ÚhttpÚcookiesÚSimpleCookieÚitemsÚgetÚ
startswithr   ÚupdateÚlower)r   Ú
set_cookieÚsimpleCookieÚkÚvr
   Úcookier   r   r   Úadd   s   

"
€özSimpleCookieJar.addc                 C   sX   |r(t j |¡}| ¡ D ]\}}| d¡}|r'| d¡s d| }|| j| ¡ < qd S d S r	   )r   r   r   r   r   r   r   r   )r   r   r   r   r   r
   r   r   r   Úset+   s   

€øzSimpleCookieJar.setc              	   C   sx   |sdS g }| j  ¡ D ]\}}| ¡ }| |¡s ||dd … kr)| | j  |¡¡ qd td tdd„ td |ƒD ƒƒƒ¡S )NÚ é   z; c                 S   s,   g | ]}|  ¡ D ]\}}d ||jf ‘qqS )z%s=%s)r   Úvalue)Ú.0r   r   r   r   r   r   Ú
<listcomp>B   s   , z'SimpleCookieJar.get.<locals>.<listcomp>)	r   r   r   ÚendswithÚappendr   ÚjoinÚfilterÚsorted)r   Zhostr   r
   r   r   r   r   r   6   s   €ÿÿzSimpleCookieJar.getN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r      s
    r   )Ú__doc__Zhttp.cookiesr   r   r   r   r   r   Ú<module>   s    