Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/language_support_pkgs.pyc


jdQc@sMddlZddlZdZdddYZddZddZdS(iNs-/usr/share/language-selector/data/pkg_dependstLanguageSupportcBseZdZdddZedZedZedZedZ	dZ
dZdZe
dZe
d	Ze
d
ZRS(cCsC|dkrtj|_n	||_|j|p6t|_dS(N(tNonetapttCachet	apt_cachet_parse_pkg_dependstDEFAULT_DEPENDS_FILEtpkg_depends(tselfRtdepends_file((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyt__init__s
	cCsg}|jj|i}xY|j|j|ijD]6}x-|D]%}||jkrJ|j|qJqJWq=Wxm|jdijD]S}xJ|D]B}	x9|j|	|D]%}
|
|jkr|j|
qqWqWqW|sg|D]}|j|js|^q}n|S(sGet language support packages for a package and locale.

        Note that this does not include support packages which are not specific
        to a particular trigger package, e. g. general language packs. To get
        those, call this with package==''.

        By default, only return packages which are not installed. If installed
        is True, return all packages instead.
        t(Rtgett_langcode_from_localetvaluesRtappendt_expand_pkg_patternt	installed(RtpackagetlocaleRtpackagestdepmaptpkglisttptpattern_listtpatternt
pkg_candidate((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pytby_package_and_locales
(

,cCsqg}xd|jD]Y}y<|dks5|j|jrQ||j|||7}nWqtk
rhqqXqW|S(sGet language support packages for a locale.

        Return all packages which need to be installed in order to provide
        language support for the given locale for all already installed
        packages. This should be called after adding a new locale to the
        system.

        By default, only return packages which are not installed. If installed
        is True, return all packages instead.
        R(RRRRtKeyError(RRRRttrigger((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyt	by_locale3s 
cCs@t}x0|jD]"}|j|j|||qW|S(s:Get language support packages for a package.

        This will install language support for that package for all available
        system languages. This is a wrapper around available_languages() and
        by_package_and_locale().

        Note that this does not include support packages which are not specific
        to a particular trigger package, e. g. general language packs. To get
        those, call this with package==''.

        By default, only return packages which are not installed. If installed
        is True, return all packages instead.
        (tsettavailable_languagestupdateR(RRRRtlang((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyt
by_packageIs	 cCsFt}x-|jD]}|j|j||qW|j|S(sLGet language support packages for current system.

        Return all packages which need to be installed in order to provide
        language support all system locales for all already installed
        packages. This should be called after installing the system without
        language support packages (perhaps because there was no network
        available to download them).

        This is a wrapper around available_languages() and by_locale().

        By default, only return packages which are not installed. If installed
        is True, return all packages instead.
        (RR R!Rt_hunspell_frami_special(RRRR"((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pytmissing\s	cCsg}x]dddgD]L}d|d}y$|j|jrM|j|nWqtk
raqXqWt|dkr||St}x.|D]&}|d|kr|j|qqW|S(sy Ignore missing hunspell-de-xx if hunspell-de-xx-frami is installed.

        https://launchpad.net/bugs/1103547
        tdetattchshunspell-de-s-framii(RRRRtlenRtadd(RRtframistcountrytframitpackages_newtpack((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyR$os
	
cCsut}tjdgdt}xM|jD]?}|j||jds.|j|jddq.q.W|S(sList available languages in the system.

        The list items can be passed as the "locale" argument of by_locale(),
        by_package_and_locale(), etc.
        s*/usr/share/language-tools/language-optionstuniversal_newlinestzh_t_i(Rt
subprocesstcheck_outputtTruetsplitR*t
startswith(Rt	languagestlang_stringR"((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyR s			
!c	
Csi}t|}x|D]z}|j}|s|jdrJqn|jd\}}}}|j|ij|ij|gj|qWWdQX|S(sqParse pkg_depends file.

        Return trigger_package -> langcode -> category -> [dependency,...] map.
        t#t:N(topentstripR7R6t
setdefaultR(	RtfilenametmaptftlinetcattlcRtdep((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyRs
!cCsI|jds|jdr"dS|jdr5dS|jdddS(	s:Turn a locale name into a language code as in pkg_depends.tzh_CNtzh_SGszh-hansR1szh-hantR2ii(R7R6(tklassR((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyR
s
cCs|dkrd}n|dkr*d}n|jdddj}d}d}yC|jdd\}}d	|kr|jd	d\}}nWntk
r|}nX|d
||fg}|r|jd|||f|jd|||fnNxK|j|D]:}|jd|||f|jd|||fqW|rs|jd|||fn|r|r|jd
||||fn|dkr|dkr|j|dq|j|dn|S(s9Return all possible suffixes for given pattern and localeszh-hansRFszh-hanttzh_TWt.iiR2t@s%s%ss%s%s%ss%s%s-%ss
%s%s-%s-%stzhtcntsgN(RMRN(R6tlowerRt
ValueErrorRt_countries_for_lang(RHRRtvariantR,R"tpkgs((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyRs<		

 c
Cs|jd	kri|_td}x|D]}|jdddjdd}|scq.n|jdddjdd}y|jd\}}Wntk
rq.nX|j}|jj|tj|q.WWd	QXn|jj	|gS(
s-Return a list of countries for given languages/usr/share/i18n/SUPPORTEDR:iit RJRKR2N(
tlang_country_mapRR<R6RPROR>RR*R(RHR"RARBtltc((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyRQs	
##
,N(t__name__t
__module__RRUR
tFalseRRR#R%R$R RtclassmethodR
RRQ(((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyRs				/cCs}t||}t}x9|jD]+}|jr%|j|j|jq%q%Wx"|D]}||jdtq[WdS(sCAdd language support for packages marked for installation.
    
    For all packages which are marked for installation in the given apt.Cache()
    object, mark the corresponding language packs and support packages for
    installation as well.

    This function can be used as an aptdaemon modify_cache_after plugin.
    t	from_userN(	RRtget_changestmarked_installR!R#tnametmark_installRZ(tresolvertcacheR	tlstsupport_pkgstpkg((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pytapt_cache_add_language_packss			 
cCs{|jds"td|n|jdddd }t||}|j|dt}g|D]}||^qgS(s,PackageKit WhatProvides plugin for locale().slocale(scannot handle query type t(iiR(R7tNotImplementedErrorR6RRR5(RbttypetsearchR	RRcRSR((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pytpackagekit_what_provides_locales((RR3RRRRfRk(((s9/usr/lib/python2.7/dist-packages/language_support_pkgs.pyt<module>s