Current Path : /usr/share/apt-xapian-index/plugins/ |
Current File : //usr/share/apt-xapian-index/plugins/cataloged_time.pyc |
ó b3Rc @ sŒ y d d l Z e Z Wn e k r/ e Z n Xd d l Z d d l Z d d l Z d d l Z d d l Z d d d „ ƒ YZ d „ Z d S( iÿÿÿÿNt CatalogedTimec B sJ e Z d Z d Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( s /var/lib/apt-xapian-index/s cataloged_times.pc C s³ t d d d t d d d d ƒ g d t d t j j | j | j ƒ d d ƒ g ƒ } t s^ | St t d ƒ sq | St j j d ƒ } t j j | ƒ s™ | St j j | ƒ | 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 timestampi t valuest namet catalogedtimet descs Cataloged timestampt sourcest paths( first-seen information for every packaget configs Dir::Cache::pkgcache( t dictt osR t joint PERSISTANCE_DIRt CATALOGED_NAMEt HAS_APTt hasattrt apt_pkgR t find_filet existst getmtime( t selft rest fname( ( s5 /usr/share/apt-xapian-index/plugins/cataloged_time.pyt info s c C sá t j | j t j ƒ ra t j j | j ƒ s@ t j | j ƒ n t j j | j | j ƒ | _ n d | _ | j r¦ t j j | j ƒ r¦ t j t | j ƒ ƒ | _ n i | _ t j ƒ | _ | d } | j d d ƒ | _ d S( 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. R R iÿÿÿÿN( R t accessR t W_OKR R t makedirsR R t _packages_cataloged_filet Nonet cPicklet loadt opent _package_cataloged_timet timet nowt gett value( R R t progressR ( ( s5 /usr/share/apt-xapian-index/plugins/cataloged_time.pyt init4 s c C s t d d d d d d ƒ 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 s Cataloged timet shortDescs8 store the timestamp when the package was first catalogedt fullDocsÈ 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.pyt docO s c C sK | j j | j | j ƒ } | | j | j <| j | j t j | ƒ ƒ d S( 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# R R"