U
    muf  ã                   @   sf   d Z ddlZzddlmZ W n  ek
r<   ddlmZ Y nX dd„ Zdd„ Zedkrbe	ed	ƒƒ dS )
zÂ

    webencodings.mklabels
    ~~~~~~~~~~~~~~~~~~~~~

    Regenarate the webencodings.labels module.

    :copyright: Copyright 2012 by Simon Sapin
    :license: BSD, see LICENSE for details.

é    N)Úurlopenc                 C   s   | |   ¡ kst‚| S ©N)ÚlowerÚAssertionError)Ústring© r   ú9/tmp/pip-unpacked-wheel-yxxkguyi/webencodings/mklabels.pyÚassert_lower   s    r	   c                    sf   dg}dd„ t  t| ƒ ¡  d¡¡D ƒ}tdd„ |D ƒƒ‰ | ‡ fdd„|D ƒ¡ | d¡ d	 |¡S )
Na  """

    webencodings.labels
    ~~~~~~~~~~~~~~~~~~~

    Map encoding labels to their name.

    :copyright: Copyright 2012 by Simon Sapin
    :license: BSD, see LICENSE for details.

"""

# XXX Do not edit!
# This file is automatically generated by mklabels.py

LABELS = {
c                 S   sL   g | ]D}|d  D ]6}|d D ](}t t|ƒƒ d¡t |d ƒ d¡f‘qqqS )Ú	encodingsÚlabelsÚuÚname)Úreprr	   Úlstrip)Ú.0ÚcategoryÚencodingÚlabelr   r   r   Ú
<listcomp>,   s   
 
 üÿzgenerate.<locals>.<listcomp>Úasciic                 s   s   | ]\}}t |ƒV  qd S r   ©Úlen©r   r   r   r   r   r   Ú	<genexpr>2   s     zgenerate.<locals>.<genexpr>c                 3   s,   | ]$\}}d |dˆ t |ƒ  |f V  qdS )z    %s:%s %s,
ú Nr   r   ©Úmax_lenr   r   r   3   s   ÿÚ}Ú )	ÚjsonÚloadsr   ÚreadÚdecodeÚmaxÚextendÚappendÚjoin)ÚurlÚpartsr   r   r   r   Úgenerate   s    ýþ
r)   Ú__main__z.http://encoding.spec.whatwg.org/encodings.json)
Ú__doc__r   Úurllibr   ÚImportErrorÚurllib.requestr	   r)   Ú__name__Úprintr   r   r   r   Ú<module>   s   !