Logo Search packages:      
Sourcecode: zeitgeist-extensions version File versions  Download package

def fts::Indexer::_index_actor (   self,
  actor 
) [private]

Takes an actor as a path to a .desktop file or app:// uri
and index the contents of the corresponding .desktop file
into the document currently set for self._tokenizer.

Definition at line 396 of file fts.py.

00396                                     :
            """
            Takes an actor as a path to a .desktop file or app:// uri
            and index the contents of the corresponding .desktop file
            into the document currently set for self._tokenizer.
            """
            if not actor : return
            
            # Get the path of the .desktop file and convert it to
            # an app id (eg. 'gedit.desktop')
            scheme, host, path = self._split_uri(url_unescape (actor))
            if not path:
                  path = host
            
            if not path :
                  log.debug("Unable to determine application id for %s" % actor)
                  return
            
            if path.startswith("/") :
                  path = os.path.basename(path)
            
            desktop = self._get_desktop_entry(path)
            if desktop:
                  if not desktop.getNoDisplay():
                        self._tokenizer.index_text(desktop.getName(), 5)
                        self._tokenizer.index_text(desktop.getName(), 5, "A")
                        self._tokenizer.index_text(desktop.getGenericName(), 5)
                        self._tokenizer.index_text(desktop.getGenericName(), 5, "A")
                        self._tokenizer.index_text(desktop.getComment(), 2)
                        self._tokenizer.index_text(desktop.getComment(), 2, "A")
                  
                        doc = self._tokenizer.get_document()
                        for cat in desktop.getCategories():
                              doc.add_term(FILTER_PREFIX_XDG_CATEGORY+cat.lower())
            else:
                  log.debug("Unable to look up app info for %s" % actor)
            
      
      def _index_uri (self, uri):


Generated by  Doxygen 1.6.0   Back to index