~mvo/software-center/hopefully-fix-lp1008229

« back to all changes in this revision

Viewing changes to softwarecenter/db/database.py

  • Committer: Michael Vogt
  • Date: 2012-01-03 11:27:15 UTC
  • mto: This revision was merged to the branch mainline in revision 2622.
  • Revision ID: michael.vogt@ubuntu.com-20120103112715-0ju4gulzjtdea683
move channels-check/update code into a seperate script to avoid UI stall

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import xapian
26
26
from softwarecenter.db.application import Application
27
27
from softwarecenter.db.utils import get_query_for_pkgnames
 
28
from softwarecenter.db.pkginfo import get_pkg_info
 
29
import softwarecenter.paths
28
30
 
29
31
from gi.repository import GObject
30
32
 
122
124
                              GObject.TYPE_NONE,
123
125
                              (GObject.TYPE_STRING,)),
124
126
                    }
125
 
    def __init__(self, pathname, cache):
 
127
    def __init__(self, pathname=None, cache=None):
126
128
        GObject.GObject.__init__(self)
 
129
        if pathname is None:
 
130
            pathname = softwarecenter.paths.XAPIAN_PATH
127
131
        self._db_pathname = pathname
 
132
        if cache is None:
 
133
            cache = get_pkg_info()
128
134
        self._aptcache = cache
129
135
        self._additional_databases = []
130
136
        # the xapian values as read from /var/lib/apt-xapian-index/values