Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/Tools/scripts/__pycache__/parseentities.cpython-35.pyc



��Yf��@s�dZddlZddlZejd�Zdddd�Zdd�Zedkr�eej	�d	kr�e
ej	d	�Zn	ejZeej	�d
kr�e
ej	d
d�Z
n	ejZ
ej�Zee�Zee
e�dS)a� Utility for parsing HTML entity definitions available from:

      http://www.w3.org/ as e.g.
      http://www.w3.org/TR/REC-html40/HTMLlat1.ent

    Input is read from stdin, output is written to stdout in form of a
    Python snippet defining a dictionary "entitydefs" mapping literal
    entity name to character or numeric entity.

    Marc-Andre Lemburg, mal@lemburg.com, 1999.
    Use as you like. NO WARRANTIES.

�Nz7<!ENTITY +(\w+) +CDATA +"([^"]+)" +-- +((?:.|
)+?) *-->cCs|d}|dkrt|�}i}xQtj|||�}|sCP|j�\}}}||f||<|j�}q'W|S)Nr)�len�entityRE�search�groups�end)�text�pos�endpos�d�m�name�charcode�comment�r�@/opt/alt/python35/lib64/python3.5/Tools/scripts/parseentities.py�parsesrcCs�|jd�t|j��}x�|D]�\}\}}|dd�dkr�t|dd
��}|dkr}d|}q�t|�}nt|�}dj|j��}|jd|||f�q&W|jd	�dS)Nzentitydefs = {
�z&#��z'\%o'� z    '%s':	%s,  	# %s
z
}
���)�write�sorted�items�int�repr�join�split)�f�defsrrr
r�coderrr�	writefile"s

r!�__main__rr�w)�__doc__�re�sys�compilerrr!�__name__r�argv�openZinfile�stdinZoutfile�stdout�readrrrrrr�<module>s