Your IP : 172.28.240.42


Current Path : /usr/share/apt-xapian-index/plugins/
Upload File :
Current File : //usr/share/apt-xapian-index/plugins/translated-desc.pyc

ó
b3Rc@sìyddlZeZWnek
r/eZnXddlZddlZddlZddlZddl	Z	yddl
mZWn!ek
r£ddlmZnXdZ
dd„Zdd
d„ƒYZddd„ƒYZdd	„ZdS(iÿÿÿÿN(tdeb822s/var/lib/apt/listsccs•tjdƒ}xtjtƒD]n}|j|ƒ}|s@qn|ra|jdƒ|kraqntj|jdƒƒtj	j
t|ƒfVqWdS(Ns_i18n_Translation-([^-]+)$i(tretcompiletostlistdirt
APTLISTDIRtsearchtgroupturllibtunquotetpathtjoin(tlangsttfiletftmo((s6/usr/share/apt-xapian-index/plugins/translated-desc.pyttranslationFilesstIndexercBseZd„Zd„ZRS(cCsÕ||_|jdƒd|_tjƒ|_y,tj|jƒ|_|jj|jƒWntj	k
rpnXt
ƒ|_d|j}xDtj
jt|ƒƒD]*}||kr£|||j|d<q£q£WdS(Nt_isDescription-tPackage(tlangtsplittxlangtxapiant
TermGeneratortindexertStemtstemmertset_stemmertInvalidArgumentErrortdicttdescsRtDeb822titer_paragraphstopen(tselfRtfiletdesckeytpkg((s6/usr/share/apt-xapian-index/plugins/translated-desc.pyt__init__s	
cCs?|jƒ}|jj|ƒ|jj|jj|dƒƒdS(Nt(tget_dataRtset_documenttindex_text_without_positionsRtget(R#tdocumenttname((s6/usr/share/apt-xapian-index/plugins/translated-desc.pytindex1s(t__name__t
__module__R'R/(((s6/usr/share/apt-xapian-index/plugins/translated-desc.pyRs	tTranslatedDescriptionscBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs
||_dS(N(R(R#R((s6/usr/share/apt-xapian-index/plugins/translated-desc.pyR'7scCsÃtstddƒSt|jƒ}tdgg|D]\}}tjj|ƒ^q2ƒ}td|dg|D]%\}}td|dd|ƒ^qmdtdd	d
dddddd
dƒgƒS(s
        Return general information about the plugin.

        The information returned is a dict with various keywords:
         
         timestamp (required)
           the last modified timestamp of this data source.  This will be used
           to see if we need to update the database or not.  A timestamp of 0
           means that this data source is either missing or always up to date.
         values (optional)
           an array of dicts { name: name, desc: description }, one for every
           numeric value indexed by this data source.

        Note that this method can be called before init.  The idea is that, if
        the timestamp shows that this plugin is currently not needed, then the
        long initialisation can just be skipped.
        t	timestampitsourcesR
tdescs%s translationtprefixestidxtZtqpttypesStemmed forms of keywordstldescsdThis contains the stemmed forms of keywords as generated by TermGenerator and matched by QueryParserN(	tHAS_APTRRRtmaxRR
tgetmtimetNone(R#tfilelisttlRtmaxts((s6/usr/share/apt-xapian-index/plugins/translated-desc.pytinfo:s
82cCsgg|_xWt|jƒD]F\}}|jd||fƒ|jjt||ƒƒ|jƒqWdS(s5
        If needed, perform long initialisation tasks here.

        info is a dictionary with useful information.  Currently it contains
        the following values:

          "values": a dict mapping index mnemonics to index numbers

        The progress indicator can be used to report progress.
        sReading %s translations from %sN(tindexersRRtbegintappendRtend(R#RCtprogressRR$((s6/usr/share/apt-xapian-index/plugins/translated-desc.pytinitZs
	cCstddddddtƒS(s+
        Return documentation information for this data source.

        The documentation information is a dictionary with these keys:
          name: the name for this data source
          shortDesc: a short description
          fullDoc: the full description as a chapter in ReST format
        R.sTranslated package descriptionst	shortDescsUterms extracted from the translated package descriptions using Xapian's TermGeneratortfullDocs5
            The TranslatedDescriptions data source reads translated description
            files from %s, then uses Xapian's TermGenerator to tokenise and
            index their content.

            Currently this creates normal terms as well as stemmed terms
            prefixed with ``Z``.
            (RR(R#((s6/usr/share/apt-xapian-index/plugins/translated-desc.pytdocls	cCs%x|jD]}|j|ƒq
WdS(sÂ
        Update the document with the information from this data source.

        document  is the document to update
        pkg       is the python-apt Package object for this package
        N(RDR/(R#R-R&ti((s6/usr/share/apt-xapian-index/plugins/translated-desc.pyR/‚scCs%x|jD]}|j|ƒq
WdS(s7
        Update the document with the information from this data source.

        This is alternative to index, and it is used when indexing with package
        data taken from a custom Packages file.

        document  is the document to update
        pkg       is the Deb822 object for this package
        N(RDR/(R#R-R&RM((s6/usr/share/apt-xapian-index/plugins/translated-desc.pytindexDeb822Œs
(R0R1R'RCRIRLR/RN(((s6/usr/share/apt-xapian-index/plugins/translated-desc.pyR26s		 			
cKs\ts
dS|sdSgt|ƒD]\}}|^q!}t|ƒdkrOdStd|ƒS(s.
    Create and return the plugin object.
    iRN(R<R?RtlenR2(RtkwRARtfiles((s6/usr/share/apt-xapian-index/plugins/translated-desc.pyRI™s%(((tapttTrueR<tImportErrortFalseRRRtos.pathRtdebianRt
debian_bundleRR?RRR2RI(((s6/usr/share/apt-xapian-index/plugins/translated-desc.pyt<module>s 


$

c