Your IP : 172.28.240.42


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


b3Rc@sy"ddlZddlZeZWnek
r;eZnXddlZddlZddlZdddYZ	dZ
dS(iNtSizescBs5eZdZdZdZdZdZRS(c
Kstdddtddddtdddd	g}|jd
trtsU|Stjjd}tjj	|s}|Stjj
|}nd}d}td
|ddg|d<||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
installedsizetdescsinstalled sizetpackagesizespackage sizetsystemsDir::Cache::pkgcaches(stdin)tpaths	APT indextsources(tdicttgettTruetHAS_APTtapt_pkgtconfigt	find_filetosRtexiststgetmtime(tselftkwtrestfiletts((s,/usr/share/apt-xapian-index/plugins/sizes.pytinfos 
cCstddddddS(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
        RRt	shortDescspackage sizes indexed as valuestfullDocs
            The Sizes data source indexes the package size and the installed
            size as the ``packagesize`` and ``installedsize`` Xapian values.
            (R
(R((s,/usr/share/apt-xapian-index/plugins/sizes.pytdoc0s	cCs8|d}|jdd|_|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.
        RRiRN(Rt
val_inst_sizetval_pkg_size(RRtprogressR((s,/usr/share/apt-xapian-index/plugins/sizes.pytinitBs
cCs|j}|dkrdSy|j}|j}WndSX|jdkrh|j|jtj|n|jdkr|j|jtj|ndS(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
        Ni(	t	candidatetNonetinstalled_sizetsizeRt	add_valuetxapiantsortable_serialiseR(RtdocumenttpkgtvertinstSizetpkgSize((s,/usr/share/apt-xapian-index/plugins/sizes.pytindexRs		
cCsy$t|d}t|d}WndSX|jdkr]|j|jtj|n|jdkr|j|jtj|ndS(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
        sInstalled-SizetSizeNi(tintRR%R&R'R(RR(R)R+R,((s,/usr/share/apt-xapian-index/plugins/sizes.pytindexDeb822fs
(t__name__t
__module__RRR R-R0(((s,/usr/share/apt-xapian-index/plugins/sizes.pyR
s
	%			cCstS(s.
    Create and return the plugin object.
    (R(((s,/usr/share/apt-xapian-index/plugins/sizes.pyR {s((taptRRR
tImportErrortFalseR&Rtos.pathRR (((s,/usr/share/apt-xapian-index/plugins/sizes.pyt<module>s


q