Edit file File name : Locale.cpython-36.pyc Content :3 %��Go � @ sF d Z ddlZddlmZ dZdd� Zddd�Zdd d �Zg ae� dS ) z� Helper Module for Locale settings This module is based on a ROX module (LGPL): http://cvs.sourceforge.net/viewcvs.py/rox/ROX-Lib2/python/rox/i18n.py?rev=1.3&view=log � N)� normalizez?(\[([a-zA-Z]+)(_[a-zA-Z]+)?(\.[a-zA-Z\-0-9]+)?(@[a-zA-Z]+)?\])?c C s t | �} d}d }d }d}| jd�}|dkrL| |d � }| d |� } ||O }nd}| jd�}d}|dkrr| d |� } | jd�}|dkr�| |d � }| d |� } ||O }nd}| } g } x`t|d �D ]P}|| @ s�| }||@ r�||7 }||@ � r�||7 }||@ �r||7 }| j|� q�W | j� | S )N� r � �@� �.�_r r � )r �find�range�append�reverse) �localeZCOMPONENT_CODESETZCOMPONENT_MODIFIERZCOMPONENT_TERRITORY�mask�posZmodifierZcodesetZ territory�language�ret�i�val� r �/usr/lib/python3.6/Locale.py�_expand_lang sF r c C sp | d kr6g } x(dD ] }t jj|�}|r|jd�} P qW g }x0| D ](}x"t|�D ]}||krN|j|� qNW q@W |S )N�LANGUAGE�LC_ALL�LC_MESSAGES�LANG�:)r r r r )�os�environ�get�splitr r )Z languagesZenvarr ZnelangsZlangZnelangr r r �expand_languages3 s r! c C s | rt | g�ant � ad S )N)r! �langs)r r r r �updateG s r# )N)N) �__doc__r r r Zregexr r! r# r"