Your IP : 216.73.216.213


Current Path : /opt/alt/python36/lib64/python3.6/Tools/i18n/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/Tools/i18n/__pycache__/makelocalealias.cpython-36.opt-1.pyc

3

� f��@sdZddlZddlZeZdZdZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zedk�rddl
Z
e
j�Zejdeded�ejdeded�ej�Zejj�Zejeej��ejeej��x"ee�Ze
e�Zee�ekr�Pq�We	eej�e�ed�ee�ed�dS)z�
    Convert the X11 locale.alias file into a mapping dictionary suitable
    for locale.py.

    Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10.

�Nz"/usr/share/X11/locale/locale.aliasz/usr/share/i18n/SUPPORTEDc
Cs*t|dd��}t|�}WdQRXi}�x�|D]�}|j�}|s>q,|dd�dkrPq,|j�\}}d|kr�|jd�\}}}	d|	kr�|	jd�\}	}}
|d|
d|	}|d
dkr�|dd�}|j�}t|�dkr�|dkr�q,d|k�r|jd�dd	�\}}|jd
d�}|jdd�}|d|}|||<q,W|S)N�latin1)�encoding��#�@�.�:�c��-��_���r)�open�list�strip�split�	partition�lower�len�replace)
�filename�f�lines�data�line�locale�aliasZ
alias_langr
Z	alias_modZ	alias_enc�langr�r�?/opt/alt/python36/lib64/python3.6/Tools/i18n/makelocalealias.py�parses6
r!c
Cs*t|dd��}t|�}WdQRXi}�x�|D]�}|j�}|s>q,|dd�dkrPq,|jdd�j�}|jd�j�}|j�}t|�dkr�q,|\}}|j�}d	|kr�|jd	�dd�\}	}
|
jd
d�}
|
jdd�}
|	d	|
}|jd
�\}}}t	j
||�}|�r|dk�o|dk�r|d
|7}|||<q,W|S)Nr)rrr�/� �\r
rrrr
rZeurozISO-8859-15)rrrr�rstriprrrr�_localeZ_replace_encoding)
rrrrrZwordsrZalias_encodingrrrr
Zmodifierrrr �parse_glibc_supported5s6r'cCs6t|j��}x$|D]\}}tdd||f�qWdS)Nz    %-40s%a,z%a:)�sorted�items�print)rr)�k�vrrr �pprintVsr-cCsbt|j��}xP|D]H\}}||kr0td|�q||||krtd|||||f�qWdS)Nz#    removed %az#    updated %a -> %a to %a)r(r)r*)rZolddatar)r+r,rrr �print_differences[sr.cCsltj}|j�t_x4|j�D](\}}tj|=tj|�|kr|tj|<qWtj}t|�}|t_|rhtjd�|S)Nr)r�locale_alias�copyr)�	normalize�check�sys�exit)rr/r+r,�newdata�errorsrrr �optimizees

r7cCsRd}xH|j�D]<\}}tj|�|krtd|tj|�|ftjd�|d7}qW|S)NrzERROR: %a -> %a != %a)�filer)r)rr1r*r3�stderr)rr6r+r,rrr r2ss
r2�__main__z--locale-aliasz,location of the X11 alias file (default: %a))�default�helpz--glibc-supportedz:location of the glibc SUPPORTED locales file (default: %a)zlocale_alias = {�})�__doc__rr3r&ZLOCALE_ALIASZ	SUPPORTEDr!r'r-r.r7r2�__name__�argparse�ArgumentParser�parser�add_argument�
parse_args�argsr/r0r�updateZglibc_supportedr�nr*rrrr �<module>sD#!