~ubuntu-branches/ubuntu/raring/software-center/raring-proposed

« back to all changes in this revision

Viewing changes to softwarecenter/db/database.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2012-12-06 17:30:50 UTC
  • Revision ID: package-import@ubuntu.com-20121206173050-n7mxi5fzlsvtdh9l
Tags: 5.5.2
* lp:~mvo/software-center/fix-pygobject-deprecation-warnings:
  - fix deprecation warninings with the latest python-gi
* lp:~mvo/software-center/minor-logging-fixes:
  - drop some LOG.info() messages to LOG.debug() to spam the user
    less
* lp:~mvo/software-center/trivial-close-ui-tweak:
  - hide the main window immediately when closing down
* lp:~mvo/software-center/5.4-fix-save-person-to-config:
  - This branch ensures that the "username" is saved everytime
    that the ubuntu sso whoami call is done
* lp:~mvo/software-center/use-dpkg-builddeps:
  - use dpkg-checkbuilddeps to find test-dependencies
* lp:~mvo/software-center/update-sc-cmdline-flexibility:
  - update-software-center-agent: 
    + add --target-db-path commandline
  - update-software-center: 
    + add --app-install-desktop-dir and --target-db-path commandline
* lp:~mvo/software-center/raring-pep8:
  - fixes for new pep8

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from softwarecenter.db.pkginfo import get_pkg_info
28
28
import softwarecenter.paths
29
29
 
30
 
from gi.repository import GObject, Gio
 
30
from gi.repository import GObject, Gio, GLib
31
31
 
32
32
from softwarecenter.utils import ExecutionTime
33
33
from softwarecenter.enums import (
34
34
    AVAILABLE_FOR_PURCHASE_MAGIC_CHANNEL_NAME,
35
35
    PkgStates,
36
36
    XapianValues
37
 
    )
 
37
)
38
38
 
39
39
from softwarecenter.paths import XAPIAN_BASE_PATH_SOFTWARE_CENTER_AGENT
40
40
from gettext import gettext as _
223
223
 
224
224
    def open(self, pathname=None, use_axi=True, use_agent=True):
225
225
        """ open the database """
226
 
        LOG.info("open() database: path=%s use_axi=%s "
 
226
        LOG.debug("open() database: path=%s use_axi=%s "
227
227
                          "use_agent=%s" % (pathname, use_axi, use_agent))
228
228
        if pathname:
229
229
            self._db_pathname = pathname
265
265
        # we only care about the utime() update from update-a-x-i
266
266
        if not event == Gio.FileMonitorEvent.ATTRIBUTE_CHANGED:
267
267
            return
268
 
        LOG.info("afile '%s' changed" % afile)
 
268
        LOG.debug("afile '%s' changed" % afile)
269
269
        if self._timeout_id:
270
 
            GObject.source_remove(self._timeout_id)
 
270
            GLib.source_remove(self._timeout_id)
271
271
            self._timeout_id = None
272
 
        self._timeout_id = GObject.timeout_add(500, self.reopen)
 
272
        self._timeout_id = GLib.timeout_add(500, self.reopen)
273
273
 
274
274
    def add_database(self, database):
275
275
        self._additional_databases.append(database)
290
290
 
291
291
    def reopen(self):
292
292
        """ reopen the database """
293
 
        LOG.info("reopen() database")
 
293
        LOG.debug("reopen() database")
294
294
        self.open(use_axi=self._use_axi, use_agent=self._use_agent)
295
295
        self.emit("reopen")
296
296