%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib64/python2.7/site-packages/tornado/
Upload File :
Create Path :
Current File : //usr/lib64/python2.7/site-packages/tornado/locale.pyo

�
��L]c@�s2	dZddlmZmZmZmZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddlmZdaiaetg�aeadZd	�Zd
�Zd�Zd�Zd
�Zdefd��YZdefd��YZdefd��YZ i>ied�d6ed�d6d6ied�d6ed�d6d6ied�d6ed�d6d6ied�d6ed�d6d 6ied!�d6ed"�d6d#6ied$�d6ed%�d6d&6ied'�d6ed(�d6d)6ied*�d6ed+�d6d,6ied-�d6ed.�d6d/6ied0�d6ed1�d6d26ied3�d6ed4�d6d56ied6�d6ed7�d6d86ied9�d6ed9�d6d:6ied;�d6ed;�d6d6ied<�d6ed=�d6d>6ied?�d6ed@�d6dA6iedB�d6edC�d6dD6iedE�d6edF�d6dG6iedH�d6edI�d6dJ6iedK�d6edL�d6dM6iedN�d6edO�d6dP6iedQ�d6edR�d6dS6iedT�d6edU�d6dV6iedW�d6edX�d6dY6iedZ�d6ed[�d6d\6ied]�d6ed^�d6d_6ied`�d6eda�d6db6iedc�d6edd�d6de6iedf�d6edg�d6dh6iedi�d6edj�d6dk6iedl�d6edm�d6dn6iedo�d6edp�d6dq6iedr�d6eds�d6dt6iedu�d6edv�d6dw6iedx�d6edy�d6dz6ied{�d6ed|�d6d}6ied~�d6ed�d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6ied��d6ed��d6d�6Z!dS(�s�Translation methods for generating localized strings.

To load a locale and generate a translated string::

    user_locale = tornado.locale.get("es_LA")
    print user_locale.translate("Sign out")

`tornado.locale.get()` returns the closest matching locale, not necessarily the
specific locale you requested. You can support pluralization with
additional arguments to `~Locale.translate()`, e.g.::

    people = [...]
    message = user_locale.translate(
        "%(list)s is online", "%(list)s are online", len(people))
    print message % {"list": user_locale.list(people)}

The first string is chosen if ``len(people) == 1``, otherwise the second
string is chosen.

Applications should call one of `load_translations` (which uses a simple
CSV format) or `load_gettext_translations` (which uses the ``.mo`` format
supported by `gettext` and related tools).  If neither method is called,
the `Locale.translate` method will simply return the original string.
i(tabsolute_importtdivisiontprint_functiontwith_statementN(tescape(tgen_log(tuten_USscG�s
tj|�S(s�Returns the closest match for the given locale codes.

    We iterate over all given locale codes in order. If we have a tight
    or a loose match for the code (e.g., "en" for "en_US"), we return
    the locale. Otherwise we move to the next code in the list.

    By default we return ``en_US`` if no translations are found for any of
    the specified locales. You can change the default locale with
    `set_default_locale()`.
    (tLocaletget_closest(tlocale_codes((s4/usr/lib64/python2.7/site-packages/tornado/locale.pytget<scC�s)|atttj��tg�adS(s7Sets the default locale.

    The default locale is assumed to be the language used for all strings
    in the system. The translations loaded from disk are mappings from
    the default locale to the destination locale. Consequently, you don't
    need to create a translation file for the default locale.
    N(t_default_localet	frozensettlistt
_translationstkeyst_supported_locales(tcode((s4/usr/lib64/python2.7/site-packages/tornado/locale.pytset_default_localeJs
c
C�siax�tj|�D]�}|jd�s1qn|jd�\}}tjd|�s�tjd|tj	j
||��qntj	j
||�}yt|ddd�}Wn tk
r�t|d�}nXit|<x�t
tj|��D]�\}}|s�t|�dkrq�ng|D]}tj|�j�^q#}|d \}	}
t|�dkry|dpsd	}nd	}|dkr�tjd|||d
�q�n|
t|j|i�|	<q�W|j�qWtttj��tg�atjdtt��dS(sLoads translations from CSV files in a directory.

    Translations are strings with optional Python-style named placeholders
    (e.g., ``My name is %(name)s``) and their associated translations.

    The directory should have translation files of the form ``LOCALE.csv``,
    e.g. ``es_GT.csv``. The CSV files should have two or three columns: string,
    translation, and an optional plural indicator. Plural indicators should
    be one of "plural" or "singular". A given string can have both singular
    and plural forms. For example ``%(name)s liked this`` may have a
    different verb conjugation depending on whether %(name)s is one
    name or a list of names. There should be two rows in the CSV file for
    that string, one with plural indicator "singular", and one "plural".
    For strings with no verbs that would change on translation, simply
    use "unknown" or the empty string (or don't include the column at all).

    The file is read using the `csv` module in the default "excel" dialect.
    In this format there should not be spaces after the commas.

    Example translation ``es_LA.csv``::

        "I love you","Te amo"
        "%(name)s liked this","A %(name)s les gustó esto","plural"
        "%(name)s liked this","A %(name)s le gustó esto","singular"

    s.csvt.s[a-z]+(_[A-Z]+)?$s!Unrecognized locale %r (path: %s)trtencodingsutf-8itunknowntpluraltsingulars.Unrecognized plural indicator %r in %s line %disSupported locales: %sN(spluralRsunknown(RtostlistdirtendswithtsplittretmatchRterrortpathtjointopent	TypeErrort	enumeratetcsvtreadertlenRt
to_unicodetstript
setdefaulttcloseR
RRRRtdebugtsorted(t	directoryR!tlocalet	extensiont	full_pathtftitrowtctenglishttranslationR((s4/usr/lib64/python2.7/site-packages/tornado/locale.pytload_translationsXs>

"(	cC�s"ddl}iax�tj|�D]�}|jd�r=q"ntjjtjj||��rdq"nyItjtjj||d|d��|j	||d|g�t|<Wq"t
k
r�}tjd|t
|��q"q"Xq"Wtttj��tg�atatjdtt��dS(	sLoads translations from `gettext`'s locale tree

    Locale tree is similar to system's ``/usr/share/locale``, like::

        {directory}/{lang}/LC_MESSAGES/{domain}.mo

    Three steps are required to have you app translated:

    1. Generate POT translation file::

        xgettext --language=Python --keyword=_:1,2 -d mydomain file1.py file2.html etc

    2. Merge against existing POT file::

        msgmerge old.po mydomain.po > new.po

    3. Compile::

        msgfmt mydomain.po -o {directory}/pt_BR/LC_MESSAGES/mydomain.mo
    iNRtLC_MESSAGESs.mot	languagess$Cannot load translation for '%s': %ssSupported locales: %s(tgettextRRRt
startswithR!tisfileR"tstatR8t	ExceptionRR tstrR
RRRRtTruet_use_gettextR-R.(R/tdomainR<tlangte((s4/usr/lib64/python2.7/site-packages/tornado/locale.pytload_gettext_translations�s"!&cC�stS(s1Returns a list of all the supported locale codes.(R(((s4/usr/lib64/python2.7/site-packages/tornado/locale.pytget_supported_locales�sRcB�s�eZdZed��Zed��Zd�Zddd�Zddd�Z	de
eed�Zde
d�Z
d	�Zd
�ZRS(s�Object representing a locale.

    After calling one of `load_translations` or `load_gettext_translations`,
    call `get` or `get_closest` to get a Locale object.
    cG�s�x�|D]�}|sqn|jdd�}|jd�}t|�dkrRqn7t|�dkr�|dj�d|dj�}n|tkr�|j|�S|dj�tkr|j|dj��SqW|jt�S(s4Returns the closest match for the given locale code.t-t_iii(treplaceRR(tlowertupperRRR(tclsR
Rtparts((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyR	�s
%
cC�s�t|d�si|_n||jkr�tj|d�}|dkrZt|i�}n'trrt||�}nt||�}||j|<n|j|S(snReturns the Locale for the given locale code.

        If it is not supported, we raise an exception.
        t_cacheN(thasattrRPRRtNonet	CSVLocaleRCt
GettextLocale(RNRttranslationsR0((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyR�sc
C�sE||_tj|i�jdtd��|_t|_x6dddgD]%}|jj|�rIt|_PqIqIW||_	|j
}|d�|d�|d�|d	�|d
�|d�|d�|d
�|d�|d�|d�|d�g|_|d�|d�|d�|d�|d�|d�|d�g|_dS(NtnametUnknowntfatarthetJanuarytFebruarytMarchtApriltMaytJunetJulytAugustt	SeptembertOctobertNovembertDecembertMondaytTuesdayt	WednesdaytThursdaytFridaytSaturdaytSunday(
RtLOCALE_NAMESRRRVtFalsetrtlR=RBRUt	translatet_monthst	_weekdays(tselfRRUtprefixRJ((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyt__init__�s	'				$$-$cC�s
t��dS(s&Returns the translation for the given message for this locale.

        If ``plural_message`` is given, you must also provide
        ``count``. We return ``plural_message`` when ``count != 1``,
        and we return the singular form for the given message when
        ``count == 1``.
        N(tNotImplementedError(Rttmessagetplural_messagetcount((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyRq
scC�s
t��dS(N(Rw(RttcontextRxRyRz((s4/usr/lib64/python2.7/site-packages/tornado/locale.pytpgettextsicC�sot|tj�r'tjj|�}ntjj�}||krm|rd||jdkrd|}qmt}n|tjd|�}|tjd|�}|tjdd�}	||}
|
j}|
j	}|j
}
d+}|s8|r{|dkr{|dkr|
dd|�i|d	6S|d,krPt|d
�}|
dd|�i|d6St|d-�}|
d
d|�i|d6S|dkr�|
d�}q8|dkr�|j
|	j
kr�|r�|r�|
d�n	|
d�}q8|dkr|r�|
d�n	|
d�}q8|dkr8|r&|
d�n	|
d�}q8n|d+kre|rV|
d�n	|
d�}n|jd.k}|r�d|j|jf}n�|jdkr�dtd �td!�f|jd"k|jd"p�d"|jf}n0d#|jd"p�d"|jd/|jd"kf}|i|j|jdd&6|j|j�d'6t|j
�d(6t|j�d)6|d*6S(0s�Formats the given date (which should be GMT).

        By default, we return a relative time (e.g., "2 minutes ago"). You
        can return an absolute date string with ``relative=False``.

        You can force a full format date ("July 10, 1980") with
        ``full_format=True``.

        This method is primarily intended for dates in the past.
        For dates in the future, we fall back to full format.
        i<tminutesthoursiii2s1 second agos%(seconds)d seconds agotsecondsgN@s1 minute agos%(minutes)d minutes agos
1 hour agos%(hours)d hours agos%(time)sit	yesterdaysyesterday at %(time)sis%(weekday)ss%(weekday)s at %(time)siNs%(month_name)s %(day)ss"%(month_name)s %(day)s at %(time)ss %(month_name)s %(day)s, %(year)ss,%(month_name)s %(day)s, %(year)s at %(time)stenRtzh_CNs%d:%02ds	%s%d:%02ds\u4e0a\u5348s\u4e0b\u5348is
%d:%02d %stamtpmt
month_nametweekdaytdaytyearttimeNi�g �@(R�RR�(R�R�(t
isinstancetnumberstRealtdatetimetutcfromtimestamptutcnowRRBt	timedeltatdaysRqRRtroundR�RthourtminuteRRrtmonthRsR�RAR�(Rttdatet
gmt_offsettrelativetshortertfull_formattnowt
local_datet	local_nowtlocal_yesterdayt
differenceRR�RJtformatR}R~ttfhour_clocktstr_time((s4/usr/lib64/python2.7/site-packages/tornado/locale.pytformat_datest
		
						" cC�s�|tjd|�}|j}|rl|d�i|j|jdd6|j|j�d6t|j�d6S|d�i|j|jdd6t|j�d6SdS(	s�Formats the given date as a day of week.

        Example: "Monday, January 22". You can remove the day of week with
        ``dow=False``.
        R}s#%(weekday)s, %(month_name)s %(day)siR�R�R�s%(month_name)s %(day)sN(	R�R�RqRrR�RsR�RAR�(RtR�R�tdowR�RJ((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyt
format_dayms	cC�s�|j}t|�dkrdSt|�dkr9|dS|jjd�rWtd�n	td�}|d�i|j|d �d	6|t|�dd
6S(s�Returns a comma-separated list for the given list of parts.

        The format is, e.g., "A, B and C", "A and B" or just "A" for lists
        of size 1.
        itiRXs \u0648 s, s%(commas)s and %(last)si����tcommastlast(RqR(RR=RR"(RtRORJtcomma((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyR�s	*cC�sf|jdkrt|�St|�}g}x%|rR|j|d�|d }q.Wdjt|��S(s7Returns a comma-separated number for the given integer.R�Ri����t,(sensen_US(RRAtappendR"treversed(RttvalueRO((s4/usr/lib64/python2.7/site-packages/tornado/locale.pytfriendly_number�s
	N(t__name__t
__module__t__doc__tclassmethodR	RRvRRRqR|RBRoR�R�RR�(((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyR�s	
	U	RScB�s,eZdZddd�Zddd�ZRS(s=Locale implementation using tornado's CSV translation format.cC�ss|dk	rN|dkr6|}|jjdi�}qc|jjdi�}n|jjdi�}|j||�S(NiRRR(RRRUR(RtRxRyRztmessage_dict((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyRq�scC�s,|jrtjd�n|j|||�S(Ns&pgettext is not supported by CSVLocale(RURtwarningRq(RtR{RxRyRz((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyR|�s	N(R�R�R�RRRqR|(((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyRS�sRTcB�s5eZdZd�Zddd�Zddd�ZRS(s1Locale implementation using the `gettext` module.cC�sey|j|_|j|_Wn)tk
rG|j|_|j|_nXtt|�j||�dS(N(t	ungettexttngettexttugettextR<tAttributeErrortsuperRTRv(RtRRU((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyRv�s
cC�s0|dk	r|j|||�S|j|�SdS(N(RRR�R<(RtRxRyRz((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyRq�scC�s�|dk	rld|t|fd|t|f|f}|j|�}t|krh|j|||�}n|Sd|t|f}|j|�}t|kr�|}n|SdS(s?Allows to set context for translation, accepts plural forms.

        Usage example::

            pgettext("law", "right")
            pgettext("good", "right")

        Plural message example::

            pgettext("organization", "club", "clubs", len(clubs))
            pgettext("stick", "club", "clubs", len(clubs))

        To generate POT file with context, add following options to step 1
        of `load_gettext_translations` sequence::

            xgettext [basic options] --keyword=pgettext:1c,2 --keyword=pgettext:1c,2,3

        .. versionadded:: 4.2
        s%s%s%sN(RRtCONTEXT_SEPARATORR�R<(RtR{RxRyRztmsgs_with_ctxttresultt
msg_with_ctxt((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyR|�s		N(R�R�R�RvRRRqR|(((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyRT�s	
t	Afrikaanstname_enRVtaf_ZAtAmharics\u12a0\u121b\u122d\u129btam_ETtArabics*\u0627\u0644\u0639\u0631\u0628\u064a\u0629tar_ARt	Bulgarians6\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438tbg_BGtBengalis\u09ac\u09be\u0982\u09b2\u09betbn_INtBosniantBosanskitbs_BAtCatalansCatal�tca_EStCzechs\u010ce\u0161tinatcs_CZtWelshtCymraegtcy_GBtDanishtDansktda_DKtGermantDeutschtde_DEtGreeks0\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03actel_GRsEnglish (UK)ten_GBsEnglish (US)sSpanish (Spain)sEspa�ol (Espa�a)tes_EStSpanishsEspa�oltes_LAtEstoniantEestitet_EEtBasquetEuskarateu_EStPersians\u0641\u0627\u0631\u0633\u06cctfa_IRtFinnishtSuomitfi_FIsFrench (Canada)sFran�ais (Canada)tfr_CAtFrenchsFran�aistfr_FRtIrishtGaeilgetga_IEtGaliciantGalegotgl_EStHebrews\u05e2\u05d1\u05e8\u05d9\u05eathe_ILtHindis$\u0939\u093f\u0928\u094d\u0926\u0940thi_INtCroatiantHrvatskithr_HRt	HungariantMagyarthu_HUt
IndonesiansBahasa Indonesiatid_IDt	Icelandics�slenskatis_IStItaliantItalianotit_ITtJapaneses\u65e5\u672c\u8a9etja_JPtKoreans\ud55c\uad6d\uc5b4tko_KRt
Lithuanians
Lietuvi\u0173tlt_LTtLatvians
Latvie\u0161utlv_LVt
Macedonians<\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438tmk_MKt	Malayalams$\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02tml_INtMalays
Bahasa Melayutms_MYsNorwegian (bokmal)sNorsk (bokm�l)tnb_NOtDutcht
Nederlandstnl_NLsNorwegian (nynorsk)sNorsk (nynorsk)tnn_NOtPunjabis$\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40tpa_INtPolishtPolskitpl_PLsPortuguese (Brazil)sPortugu�s (Brasil)tpt_BRsPortuguese (Portugal)sPortugu�s (Portugal)tpt_PTtRomaniansRom�n\u0103tro_ROtRussians*\u0420\u0443\u0441\u0441\u043a\u0438\u0439tru_RUtSlovaksSloven\u010dinatsk_SKt	SloveniansSloven\u0161\u010dinatsl_SItAlbaniantShqiptsq_ALtSerbians$\u0421\u0440\u043f\u0441\u043a\u0438tsr_RStSwedishtSvenskatsv_SEtSwahilit	Kiswahilitsw_KEtTamils\u0ba4\u0bae\u0bbf\u0bb4\u0bcdtta_INtTelugus$\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41tte_INtThais*\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22tth_THtFilipinottl_PHtTurkishsT�rk�ettr_TRsUkraini s<\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430tuk_UAt
VietnamesesTi\u1ebfng Vi\u1ec7ttvi_VNsChinese (Simplified)s\u4e2d\u6587(\u7b80\u4f53)R�sChinese (Traditional)s\u4e2d\u6587(\u7e41\u9ad4)tzh_TW("R�t
__future__RRRRR&R�R�RRttornadoRttornado.logRttornado.utilRRRR
RRoRCR�RRR9RGRHtobjectRRSRTRn(((s4/usr/lib64/python2.7/site-packages/tornado/locale.pyt<module>'s�"			B	+	�<!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Zerion Mini Shell 1.0