~gary-lasker/software-center/lp1041004

« back to all changes in this revision

Viewing changes to softwarecenter/db/utils.py

  • Committer: Michael Vogt
  • Date: 2012-10-02 07:32:30 UTC
  • mfrom: (3207.1.4 software-center)
  • Revision ID: michael.vogt@ubuntu.com-20121002073230-xvy0d4acqj3zrnx1
merged lp:~gary-lasker/software-center/de-duplication-multiple-pkgnames-lp1043159-tweak and thus lp:~mvo/software-center/de-duplication-multiple-pkgnames-lp1043159

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import logging
20
20
import os
21
 
import xapian
22
21
 
23
22
from gi.repository import GObject
24
23
 
45
44
    GObject.child_watch_add(pid, _on_update_software_center_agent_finished)
46
45
 
47
46
 
48
 
def get_query_for_pkgnames(pkgnames):
49
 
    """ return a xapian query that matches exactly the list of pkgnames """
50
 
    query = xapian.Query()
51
 
    for pkgname in pkgnames:
52
 
        query = xapian.Query(xapian.Query.OP_OR,
53
 
                             query,
54
 
                             xapian.Query("XP" + pkgname))
55
 
        query = xapian.Query(xapian.Query.OP_OR,
56
 
                             query,
57
 
                             xapian.Query("AP" + pkgname))
58
 
    return query
59
 
 
60
 
 
61
47
def get_installed_apps_list(db):
62
48
    """ return a list of installed applications """
63
49
    apps = set()