~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to lib/common/db.py

  • Committer: mattgiuca
  • Date: 2008-02-17 23:11:33 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:484
lib/common/db.py: Fixed a cascading error if the constructor throws an
exception (before self.open is set).

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
    def __init__(self):
95
95
        """Connects to the database and creates a DB object.
96
96
        Takes no parameters - gets all the DB info from the configuration."""
 
97
        self.open = False
97
98
        self.db = pg.connect(dbname=conf.db_dbname, host=conf.db_host,
98
99
                port=conf.db_port, user=conf.db_user, passwd=conf.db_password)
99
100
        self.open = True