Current Path : /usr/share/apt-xapian-index/plugins/ |
Current File : //usr/share/apt-xapian-index/plugins/app-install.pyc |
b3Rc @ s y* d d l m Z d d l m Z e Z Wn e k rE Z e Z n Xd d l Z d d l Z d d l Z d d l Z d Z d d d YZ d e f d YZ d d d Z d S( i( t DesktopEntry( t LocaleNs /usr/share/app-install/desktop/t Indexerc B s e Z d d Z d Z RS( c C s | | _ | | _ | d k r' d } n | | _ | j d d | _ t j | | _ t j | _ y, t j | j | _ | j j | j Wn t j k r n Xd S( Nt ent _i ( t val_popcont progresst Nonet langt splitt xlangR t expand_languagest xdglangst xapiant TermGeneratort indexert Stemt stemmert set_stemmert InvalidArgumentError( t selfR R R ( ( s2 /usr/share/apt-xapian-index/plugins/app-install.pyt __init__ s c C sQ | j d | j d | | j j | t j } zR | j t _ | j j | j | j j | j | j j | j Wd | t _ Xx% | j D] } | j d | q Wy t | j d } WnE t k r} | j r| j j d | t | f n d } n X| j d k rM| j | j t j | n d S( Nt XDt XDFt XDTs X-AppInstall-Popcons# %s: parsing X-AppInstall-Popcon: %si( t add_termR t set_documentR t langsR t index_text_without_positionst getNamet getGenericNamet getCommentt getCategoriest intt gett ValueErrorR t verboset strR t add_valueR t sortable_serialise( R t documentt fnamet entryt oldlangst catt popcont e( ( s2 /usr/share/apt-xapian-index/plugins/app-install.pyt index s( # N( t __name__t __module__R R R/ ( ( ( s2 /usr/share/apt-xapian-index/plugins/app-install.pyR s t AppInstallc B sJ e Z d Z d Z d Z d d Z d Z d Z d Z RS( c C s | | _ | | _ d S( N( R R ( R R R ( ( s2 /usr/share/apt-xapian-index/plugins/app-install.pyR B s c C sg d } x t j t D]z } | d d k s | j d rB q n y: t j j t j j t | } | | k r{ | } n Wq t k r q Xq Wt d | d t d d d d g d t d t d d g d t d d d d d d d d d d t d d d d d d d d d d t d d d d d d d d d d t d d d d d d d d 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. i t .s .desktopt timestampt valuest names app-popcont descs app-install .desktop popcon rankt sourcest paths+ .desktop files provided by app-install-datat prefixest idxR t qpt types; Marker to indicate that the package contains .desktop filest ldescsi Only 'XD' can present in the index. This is used to efficiently filter packages that have a .desktop fileR s File name of the .desktop filesZ This is the name of a .desktop file contained in the package. There could be more than oneR t bools Categories from .desktop filessP This is similar to a tag, but filled with the categories found in .desktop filest Zs Stemmed forms of keywordssd This contains the stemmed forms of keywords as generated by TermGenerator and matched by QueryParserN( t ost listdirt APPINSTALLDIRt endswithR9 t getmtimet joint OSErrort dictR ( R t maxtst ft ts( ( s2 /usr/share/apt-xapian-index/plugins/app-install.pyt infoF s4 ! c C s | d } | j d d | _ g d g t | j D] } t | | j | ^ q6 | _ i | _ | j d t x t j t D]x } | d d k s | j d r q n t t j j t | } | j d } | j j | g j | | f q W| j 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. R5 s app-popconis Reading .desktop files from %si R3 s .desktops X-AppInstall-PackageN( R"