a
    xÏOcé  ã                   @   s†   d Z ddlmZ ze dZW n ey2   dZY n0 es^ddlmZ dd„ Zdd	„ Z	d
d„ Z
n$ddlmZ dd„ Zdd	„ Z	dd„ Z
dS )zTTools for reading and writing PKG-INFO / METADATA without caring
about the encoding.é    )ÚParserFT)Ú	Generatorc                 C   s   t ƒ  | ¡S )N)r   Úparsestr)Úbytestr© r   úD/var/www/html/gsl.tools/lib/python3.9/site-packages/wheel/pkginfo.pyÚread_pkg_info_bytes   s    r   c                 C   s:   t | dƒ�}tƒ  |¡}W d   ƒ n1 s,0    Y  |S )NÚr©Úopenr   Úparse©ÚpathÚheadersÚmessager   r   r   Úread_pkg_info   s    *r   c                 C   sB   t | dƒ�$}t|ddd� |¡ W d   ƒ n1 s40    Y  d S )NÚwFr   ©Úmangle_from_Úmaxheaderlen)r   r   Úflatten)r   r   Úmetadatar   r   r   Úwrite_pkg_info   s    r   )ÚBytesGeneratorc                 C   s   | j ddd�}tƒ  |¡}|S )NÚasciiÚsurrogateescape©ÚencodingÚerrors)Údecoder   r   )r   r   r   r   r   r   r      s    c                 C   s@   t | dddd��}tƒ  |¡}W d   ƒ n1 s20    Y  |S )Nr	   r   r   r   r
   r   r   r   r   r   "   s    þ*c                 C   sB   t | dƒ�$}t|ddd� |¡ W d   ƒ n1 s40    Y  d S )NÚwbFr   r   )r   r   r   )r   r   Úoutr   r   r   r   )   s    N)Ú__doc__Úemail.parserr   ÚunicodeZ_PY3Ú	NameErrorÚemail.generatorr   r   r   r   r   r   r   r   r   Ú<module>   s   

