B \pl(@sdZddlZddlZeZdZdZddZddZd d Zd d Z d dZ ddZ e dkrddl Z e ZejdededejdededeZejZeeejeeejx"eeZe eZeeekrPqWe eejeedeeeddS)z Convert the X11 locale.alias file into a mapping dictionary suitable for locale.py. Written by Marc-Andre Lemburg , 2004-12-10. Nz"/usr/share/X11/locale/locale.aliasz/usr/share/i18n/SUPPORTEDc Cs(t|dd}t|}WdQRXi}x|D]}|}|s %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_|rhtd|S)Nr)r locale_aliascopyr) normalizechecksysexit)rr/r+r,newdataerrorsrrr optimizees  r7cCsRd}xH|D]<\}}t||krtd|t||ftjd|d7}qW|S)NrzERROR: %a -> %a != %a)filer)r)rr1r*r3stderr)rr6r+r,rrr r2ss  r2__main__z--locale-aliasz,location of the X11 alias file (default: %a))defaulthelpz--glibc-supportedz:location of the glibc SUPPORTED locales file (default: %a)zlocale_alias = {})__doc__rr3r&Z LOCALE_ALIASZ SUPPORTEDr!r'r-r.r7r2__name__argparseArgumentParserparser add_argument parse_argsargsr/r0rupdateZglibc_supportedrnr*rrrr sD#!