~ubuntu-core-dev/software-center/karmic

« back to all changes in this revision

Viewing changes to softwarecenter/app.py

  • Committer: Michael Vogt
  • Date: 2009-10-13 10:24:57 UTC
  • Revision ID: michael.vogt@ubuntu.com-20091013102457-7mhbf48wbxlbuhzd
* softwarecenter/db/database.py:
  - require explicit open() to avoid possible race (LP: #449385)

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
        pathname = os.path.join(xapian_base_path, "xapian")
97
97
        try:
98
98
            self.db = StoreDatabase(pathname)
 
99
            self.db.open()
99
100
        except xapian.DatabaseOpeningError:
100
101
            # Couldn't use that folder as a database
101
102
            # This may be because we are in a bzr checkout and that
106
107
                logging.info("building local database")
107
108
                rebuild_database(pathname)
108
109
                self.db = StoreDatabase(pathname)
 
110
                self.db.open()
109
111
        except xapian.DatabaseCorruptError, e:
110
112
            logging.exception("xapian open failed")
111
113
            view.dialogs.error(None, 
438
440
        if is_rebuilding:
439
441
            self.window_rebuilding.show()
440
442
        else:
441
 
            # we need to reopen when the database finished updating
 
443
            # we need to re-open when the database finished updating
442
444
            self.db.reopen()
443
445
            self.window_rebuilding.hide()
444
446