Your IP : 172.28.240.42


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

ó
b3Rc@sŒyddlZeZWnek
r/eZnXddlZddlZddlZddlZddl	Z	ddd„ƒYZ
d„ZdS(iÿÿÿÿNt
CatalogedTimecBsJeZdZdZd„Zd„Zd„Zd„Zd„Zd„Z	RS(s/var/lib/apt-xapian-index/scataloged_times.pcCs³tdddtddddƒgdtd	tjj|j|jƒdd
ƒgƒ}ts^|Sttdƒsq|Stj	j
dƒ}tjj|ƒs™|Stjj|ƒ|d<|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	timestampitvaluestnamet
catalogedtimetdescsCataloged timestamptsourcestpaths(first-seen information for every packagetconfigsDir::Cache::pkgcache(
tdicttosRtjointPERSISTANCE_DIRtCATALOGED_NAMEtHAS_APTthasattrtapt_pkgRt	find_filetexiststgetmtime(tselftrestfname((s5/usr/share/apt-xapian-index/plugins/cataloged_time.pytinfoscCsátj|jtjƒratjj|jƒs@tj|jƒntjj|j|jƒ|_	n	d|_	|j	r¦tjj|j	ƒr¦tjt
|j	ƒƒ|_n	i|_tjƒ|_|d}|jddƒ|_dS(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.
        RRiÿÿÿÿN(R
taccessRtW_OKRRtmakedirsRR
t_packages_cataloged_filetNonetcPickletloadtopent_package_cataloged_timettimetnowtgettvalue(RRtprogressR((s5/usr/share/apt-xapian-index/plugins/cataloged_time.pytinit4s			
cCstddddddƒ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
        RsCataloged timet	shortDescs8store the timestamp when the package was first catalogedtfullDocsÈ
            This datasource simply stores a value with the timestamp
            when the package was first cataloged. This is useful to e.g.
            implement a 'Whats new' feature.
            (R	(R((s5/usr/share/apt-xapian-index/plugins/cataloged_time.pytdocOs	cCsK|jj|j|jƒ}||j|j<|j|jtj|ƒƒdS(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(R R#RR"t	add_valueR$txapiantsortable_serialise(RtdocumenttpkgR!((s5/usr/share/apt-xapian-index/plugins/cataloged_time.pytindexbscCsdS(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((RR-R.((s5/usr/share/apt-xapian-index/plugins/cataloged_time.pytindexDeb822ms
cCs_|jr[t|jddƒ}tj|j|ƒ}|jƒtj|jd|jƒndS(s6
        Called when the indexing is finihsed
        s.newtwN(RRRtdumpR tcloseR
trename(RtfR((s5/usr/share/apt-xapian-index/plugins/cataloged_time.pytfinishedys	
(
t__name__t
__module__RR
RR&R)R/R0R6(((s5/usr/share/apt-xapian-index/plugins/cataloged_time.pyRs	#				cKsts
dStƒS(s.
    Create and return the plugin object.
    N(RRR(tkw((s5/usr/share/apt-xapian-index/plugins/cataloged_time.pyR&„s((RtTrueRtImportErrortFalseRR
tos.pathR!R+RR&(((s5/usr/share/apt-xapian-index/plugins/cataloged_time.pyt<module>s


x