관리-도구
편집 파일: mklabels.cpython-36.pyc
3 �Pf � @ sf d Z ddlZyddlmZ W n ek r< ddlmZ Y nX dd� Zdd� Zedkrbe ed �� dS ) z� webencodings.mklabels ~~~~~~~~~~~~~~~~~~~~~ Regenarate the webencodings.labels module. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. � N)�urlopenc C s | | j � kst�| S )N)�lower�AssertionError)�string� r �/usr/lib/python3.6/mklabels.py�assert_lower s r c sf dg}dd� t jt| �j� jd��D �}tdd� |D ��� |j� fdd�|D �� |jd� d j|�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|��jd�t |d �jd�f�qqqS )Z encodings�labels�u�name)�reprr �lstrip)�.0�category�encoding�labelr r r � <listcomp>- s zgenerate.<locals>.<listcomp>�asciic s s | ]\}}t |�V qd S )N)�len)r r r r r r � <genexpr>2 s zgenerate.<locals>.<genexpr>c 3 s, | ]$\}}d |d� t |� |f V qdS )z %s:%s %s, � N)r )r r r )�max_lenr r r 4 s �}� ) �json�loadsr �read�decode�max�extend�append�join)Zurl�partsr r )r r �generate s r# �__main__z.http://encoding.spec.whatwg.org/encodings.json) �__doc__r Zurllibr �ImportErrorZurllib.requestr r# �__name__�printr r r r �<module> s !