~michael.nelson/software-center/update-sca-client

« back to all changes in this revision

Viewing changes to softwarecenter/db/database.py

  • Committer: Michael Vogt
  • Date: 2012-12-17 08:51:40 UTC
  • mfrom: (3274.1.1 pep8-e125)
  • Revision ID: michael.vogt@ubuntu.com-20121217085140-1wkpd4sopmdw5iyo
mergedĀ lp:~mvo/software-center/pep8-e125

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
            except:
197
197
                LOG.exception("failed to add apt-xapian-index")
198
198
        if (self._use_agent and
199
 
            os.path.exists(XAPIAN_BASE_PATH_SOFTWARE_CENTER_AGENT)):
 
199
                os.path.exists(XAPIAN_BASE_PATH_SOFTWARE_CENTER_AGENT)):
200
200
            try:
201
201
                sca = xapian.Database(XAPIAN_BASE_PATH_SOFTWARE_CENTER_AGENT)
202
202
                xapiandb.add_database(sca)
324
324
        return query
325
325
 
326
326
    def get_query_list_from_search_entry(self, search_term,
327
 
        category_query=None):
 
327
                                         category_query=None):
328
328
        """ get xapian.Query from a search term string and a limit the
329
329
            search to the given category
330
330
        """
417
417
        return self.xapian_parser.get_corrected_query_string()
418
418
 
419
419
    def get_most_popular_applications_for_mimetype(self, mimetype,
420
 
        only_uninstalled=True, num=3):
 
420
                                                   only_uninstalled=True,
 
421
                                                   num=3):
421
422
        """ return a list of the most popular applications for the given
422
423
            mimetype
423
424
        """
452
453
        if not summary and self._aptcache.ready:
453
454
            pkgname = self.get_pkgname(doc)
454
455
            if (pkgname in self._aptcache and
455
 
                self._aptcache[pkgname].candidate):
 
456
                    self._aptcache[pkgname].candidate):
456
457
                return self._aptcache[pkgname].candidate.summary
457
458
            elif channel:
458
459
                # FIXME: print something if available for our arch
595
596
        for m in matches:
596
597
            pkgname = self.get_pkgname(m.document)
597
598
            if (pkgname in self._aptcache and
598
 
                self._aptcache[pkgname].is_installed):
 
599
                    self._aptcache[pkgname].is_installed):
599
600
                installed_purchased_packages.add(pkgname)
600
601
        return installed_purchased_packages
601
602