ok

Mini Shell

Direktori : /proc/thread-self/root/opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python37/lib64/python3.7/__pycache__/gettext.cpython-37.pyc

B

� f�U�@sxdZddlZddlZddlZddlZddddddd	d
ddd
ddddddgZej�ejdd�Z	e�
dejejB�Z
dd�Zdd�ZdZdd�eed�D�Zdd d!d"�Zd>d$d%�Zd&d'�Zd(d)�Zd*d+�ZGd,d�d�ZGd-d�de�Zd?d/d�ZiZd@d0d�ZdAd1d�Ziaiad2adBd3d	�Z dCd4d
�Z!dDd5d�Z"d6d�Z#d7d�Z$d8d
�Z%d9d�Z&d:d�Z'd;d�Z(d<d�Z)d=d�Z*eZ+dS)Ea�Internationalization and localization support.

This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.

I18N refers to the operation by which a program is made aware of multiple
languages.  L10N refers to the adaptation of your program, once
internationalized, to the local language and cultural habits.

�N�NullTranslations�GNUTranslations�Catalog�find�translation�install�
textdomain�bindtextdomain�bind_textdomain_codeset�dgettext�	dngettext�gettext�lgettext�	ldgettext�
ldngettext�	lngettext�ngettextZshare�localea�
        (?P<WHITESPACES>[ \t]+)                    | # spaces and horizontal tabs
        (?P<NUMBER>[0-9]+\b)                       | # decimal integer
        (?P<NAME>n\b)                              | # only n is allowed
        (?P<PARENTHESIS>[()])                      |
        (?P<OPERATOR>[-*/%+?:]|[><!]=?|==|&&|\|\|) | # !, *, /, %, +, -, <, >,
                                                     # <=, >=, ==, !=, &&, ||,
                                                     # ? :
                                                     # unary and bitwise ops
                                                     # not allowed
        (?P<INVALID>\w+|.)                           # invalid token
    ccsTxHt�t|�D]8}|j}|dkr"q|�|�}|dkr@td|��|VqWdVdS)NZWHITESPACESZINVALIDz invalid token in plural form: %s�)�re�finditer�_token_pattern�	lastgroup�group�
ValueError)�pluralZmoZkind�value�r�,/opt/alt/python37/lib64/python3.7/gettext.py�	_tokenizeVs

rcCs|rtd|�Std�SdS)Nz#unexpected token in plural form: %szunexpected end of plural form)r)rrrr�_errorasr ))z||)z&&)z==z!=)�<�>z<=z>=)�+�-)�*�/�%cCs i|]\}}|D]
}||�qqSrr)�.0�iZops�oprrr�
<dictcomp>osr+��or�andz//)z||z&&r&���cCs�d}t|�}x|dkr(|d7}t|�}qW|dkr\t|�\}}d||f}|dkr�td��nP|dkrrd	||f}n:yt|d
�}Wntk
r�t|�d�YnXd||f}t|�}d}xh|tk�r t|}||kr�P|d
kr�|d
kr�d|}t�||�}t||d�\}	}d|||	f}|}q�W||k�r:dk�rFnnd|}|dk�r�|dk�r�t|d�\}
}|dk�rzt|��t|�\}}d|
||f}|dk�r�d|}||fS)Nr�!znot �(z%s(%s)�)z%unbalanced parenthesis in plural form�nz%s%s�
z%s%d�d)��z(%s)r,z%s %s %sr7�?r�:z%s if %s else %s)�next�_parser�intr �_binary_ops�	_c2py_ops�get)�tokensZpriority�result�nexttok�subr�jr)r*�rightZif_trueZif_falserrrr;rsP



r;cCsZyt|�}Wn(tk
r4td|jjf�d�YnXddl}|�d|jjftd�|S)Nz'Plural value must be an integer, got %srr7)�round�	TypeError�	__class__�__name__�warnings�warn�DeprecationWarning)r3r)rJrrr�_as_int�s
rMcCs�t|�dkrtd��y~tt|��\}}|r2t|��d}x>|D]6}|dkrb|d7}|dkrrtd��q<|dkr<|d8}q<Wd	ti}td
||�|dStk
r�td��YnXdS)
z�Gets a C expression as used in PO files for plural forms and returns a
    Python function that implements an equivalent expression.
    i�z"plural form expression is too longrr1r,�z%plural form expression is too complexr2rMz�if True:
            def func(n):
                if not isinstance(n, int):
                    n = _as_int(n)
                return int(%s)
            �funcN)�lenrr;rr rM�exec�RecursionError)rrArBZdepth�c�nsrrr�c2py�s(

rUc
Cs8t�|�}d}d}d}d}|�d�}|dkrN||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|}	g}
x`t|d�D]P}||@s�|	}||@r�||7}||@�r||7}||@�r||7}|
�|�q�W|
��|
S)	Nr,�r7r�@r�.�_)rZ	normalizer�range�append�reverse)
ZlocZCOMPONENT_CODESETZCOMPONENT_TERRITORYZCOMPONENT_MODIFIER�mask�posZmodifier�codesetZ	territoryZlanguageZretr)�valrrr�_expand_lang�sJ









rac@speZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
ddd�ZdS)rNcCs.i|_d|_d|_d|_|dk	r*|�|�dS)N)�_info�_charset�_output_charset�	_fallbackr;)�self�fprrr�__init__�szNullTranslations.__init__cCsdS)Nr)rfrgrrrr;szNullTranslations._parsecCs|jr|j�|�n||_dS)N)re�add_fallback)rf�fallbackrrrri	szNullTranslations.add_fallbackcCs|jr|j�|�S|S)N)rer
)rf�messagerrrr
szNullTranslations.gettextcCs2|jr|j�|�S|jr$|�|j�S|�t���S)N)rerrd�encoder�getpreferredencoding)rfrkrrrrs
zNullTranslations.lgettextcCs*|jr|j�|||�S|dkr"|S|SdS)Nr,)rer)rf�msgid1�msgid2r3rrrrs
zNullTranslations.ngettextcCsH|jr|j�|||�S|dkr$|}n|}|jr:|�|j�S|�t���S)Nr,)rerrdrlrrm)rfrnror3�tmsgrrrr#szNullTranslations.lngettextcCs|jS)N)rb)rfrrr�info.szNullTranslations.infocCs|jS)N)rc)rfrrr�charset1szNullTranslations.charsetcCs|jS)N)rd)rfrrr�output_charset4szNullTranslations.output_charsetcCs
||_dS)N)rd)rfrrrrr�set_output_charset7sz#NullTranslations.set_output_charsetcCsvddl}|j|jd<t|d�rrd|kr6|jd|jd<d|krJ|j|jd<d|kr^|j|jd<d|krr|j|jd<dS)NrrY�__contains__r
rrr)�builtinsr
�__dict__�hasattrrrr)rf�namesrvrrrr:s
zNullTranslations.install)N)N)rI�
__module__�__qualname__rhr;rir
rrrrqrrrsrtrrrrrr�s
c@sHeZdZdZdZdZdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)rl�*l�$<)rr,cCs|d?|d@fS)z/Returns a tuple of major version, minor version�i��r)rf�versionrrr�
_get_versionsPszGNUTranslations._get_versionsc"Cs�ddlm}t|dd�}i|_}dd�|_|��}t|�}|d|dd	��d}||jkr||d
|d	d��\}}	}
}d}n6||jkr�|d
|d	d��\}}	}
}d}nt	dd|��|�
|�\}
}|
|jkr�t	ddt|
�|���xt
d|	�D�]�}||||
|
d��\}}||}|||||d��\}}||}||k�rd||k�rd|||�}|||�}nt	dd|��|dk�rXd}x�|�d�D]�}|����}|�s��q�d}}d|k�r�|�dd�\}}|����}|��}||j|<|}n|�r|j|d|7<|dk�r"|�d�d|_n0|dk�r�|�d�}|d�d�d}t|�|_�q�W|j�pbd}d|k�r�|�d�\}} |�d�}t||�}x>t|�D]\}}!t|!|�|||f<�q�Wnt||�|t||�<|
d7}
|d7}q�WdS)z8Override this method to support alternative .mo formats.r)�unpack�namercSst|dk�S)Nr,)r<)r3rrr�<lambda>]�z(GNUTranslations._parse.<locals>.<lambda>z<INr7z<4IrNz<IIz>4Iz>IIzBad magic numberzBad version number �zFile is corrupt�
r9r,�
zcontent-typezcharset=zplural-forms�;zplural=�ascii�)Zstructr�getattr�_catalogr�readrP�LE_MAGIC�BE_MAGIC�OSErrorr~�VERSIONS�strrZ�split�decode�strip�lowerrbrcrU�	enumerate)"rfrgr�filenameZcatalogZbufZbuflen�magicr}ZmsgcountZ	masteridxZtransidxZiiZ
major_versionZ
minor_versionr)ZmlenZmoffZmendZtlenZtoffZtend�msgrpZlastkZb_item�item�k�vrrrrnro�xrrrr;Tsr














zGNUTranslations._parsecCsRt�}|j�||�}||kr2|jr.|j�|�S|}|jrD|�|j�S|�t���S)N)	�objectr�r?rerrdrlrrm)rfrk�missingrprrrr�szGNUTranslations.lgettextcCsvy|j||�|�f}Wn<tk
rT|jr>|j�|||�S|dkrL|}n|}YnX|jrh|�|j�S|�t���S)Nr,)	r�r�KeyErrorrerrdrlrrm)rfrnror3rprrrr�s
zGNUTranslations.lngettextcCs6t�}|j�||�}||kr2|jr.|j�|�S|S|S)N)r�r�r?rer
)rfrkr�rprrrr
�szGNUTranslations.gettextcCsZy|j||�|�f}Wn<tk
rT|jr>|j�|||�S|dkrL|}n|}YnX|S)Nr,)r�rr�rer)rfrnror3rprrrr�s
zGNUTranslations.ngettextN)rIrzr{r�r�r�r~r;rrr
rrrrrrHsV	FcCs�|dkrt}|dkrTg}x(dD] }tj�|�}|r|�d�}PqWd|krT|�d�g}x0|D](}x"t|�D]}||krl|�|�qlWq^W|r�g}	nd}	xL|D]D}|dkr�Ptj�||dd|�}
tj�	|
�r�|r�|	�|
�q�|
Sq�W|	S)N)ZLANGUAGE�LC_ALL�LC_MESSAGESZLANGr9�Cr�z%s.mo)
�_default_localedir�os�environr?r�r[ra�path�join�exists)�domain�	localedir�	languages�allZenvarr`ZnelangsZlangZnelangrA�mofilerrrr�s8




c
Cs�|dkrt}t|||dd�}|sB|r*t�Sddlm}t|d|��d}x�|D]�}	|tj�|	�f}
t	�
|
�}|dkr�t|	d��}t	�|
||��}WdQRXddl
}
|
�
|�}|r�|�|�|dkr�|}qL|�|�qLW|S)NT)r�r)�ENOENTz$No translation file found for domain�rb)rrr�errnor��FileNotFoundErrorr�r��abspath�
_translationsr?�open�
setdefault�copyrtri)r�r�r�Zclass_rjr_Zmofilesr�rAr��key�trgr�rrrrs0



cCst||d|d�}|�|�dS)NT)rjr_)rr)r�r�r_ryr�rrrr&sZmessagescCs|dk	r|atS)N)�_current_domain)r�rrrr4scCs|dk	r|t|<t�|t�S)N)�_localedirsr?r�)r�r�rrrr	;scCs|dk	r|t|<t�|�S)N)�_localecodesetsr?)r�r_rrrr
BscCs@y t|t�|d�t�|�d�}Wntk
r4|SX|�|�S)N)r_)rr�r?r�r�r
)r�rkr�rrrrIscCsRt�|�}yt|t�|d�|d�}Wn"tk
rF|�|pBt���SX|�|�S)N)r_)	r�r?rr�r�rlrrmr)r�rkr_r�rrrrQs
cCsTy t|t�|d�t�|�d�}Wn$tk
rD|dkr<|S|SYnX|�|||�S)N)r_r,)rr�r?r�r�r)r�rnror3r�rrrrYs
cCsht�|�}yt|t�|d�|d�}Wn4tk
rX|dkrB|}n|}|�|pTt���SX|�|||�S)N)r_r,)	r�r?rr�r�rlrrmr)r�rnror3r_r�rprrrrds
cCs
tt|�S)N)rr�)rkrrrr
pscCs
tt|�S)N)rr�)rkrrrrsscCstt|||�S)N)rr�)rnror3rrrrvscCstt|||�S)N)rr�)rnror3rrrrys)r/)NNF)NNNFN)NNN)N)N)N),�__doc__rr�r�sys�__all__r�r��base_prefixr��compile�VERBOSE�DOTALLrrr r=r�r>r;rMrUrarrrr�rrr�r�r�rr	r
rrrrr
rrrrrrrr�<module>sX&



1$*K
&
#





Zerion Mini Shell 1.0