Your IP : 216.73.216.196


Current Path : /opt/alt/python37/lib64/python3.7/Tools/i18n/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/Tools/i18n/__pycache__/makelocalealias.cpython-37.opt-1.pyc

B

� f��@sdZddlZddlZeZdZdZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zedk�rddl
Z
e
��Zejdeded�ejdeded�e��Zej��Ze�eej��e�eej��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]�}|��}|s<q*|dd�dkrNq*|��\}}d|kr�|�d�\}}}	d|	kr�|	�d�\}	}}
|d|
d|	}|ddkr�|dd�}|��}t|�dkr�|d	kr�q*d|k�r|�d�dd
�\}}|�dd�}|�d
d�}|d|}|||<q*W|S)N�latin1)�encoding��#�@�.����:�c��-��_)�open�list�strip�split�	partition�lower�len�replace)
�filename�f�lines�data�line�locale�aliasZ
alias_langrZ	alias_modZ	alias_enc�langr�r�?/opt/alt/python37/lib64/python3.7/Tools/i18n/makelocalealias.py�parses6

r!c
	Cs&t|dd��}t|�}WdQRXi}x�|D]�}|��}|s<q*|dd�dkrNq*|�dd���}|�d���}|��}t|�dkr�q*|\}}|��}d	|kr�|�d	�dd�\}	}
|
�d
d�}
|
�dd�}
|	d	|
}|�d
�\}}}t	�
||�}|�r|dk�r
|dk�s|d
|7}|||<q*W|S)Nr)rrr�/� �\rrrr
rrZeurozISO-8859-15)rrrr�rstriprrrr�_localeZ_replace_encoding)
rrrrrZwordsrZalias_encodingrrrrZmodifierrrr �parse_glibc_supported5s6
r'cCs6t|���}x$|D]\}}tdd||f�qWdS)Nz    %-40s%a,z%a:)�sorted�items�print)rr)�k�vrrr �pprintVsr-cCsbt|���}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}|��t_x4|��D](\}}tj|=t�|�|kr|tj|<qWtj}t|�}|t_|rht�d�|S)Nr)r�locale_alias�copyr)�	normalize�check�sys�exit)rr/r+r,�newdata�errorsrrr �optimizees

r7cCsRd}xH|��D]<\}}t�|�|krtd|t�|�|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#!