class Controller(pb.Root):
def service_setup(self):
- self.connection_type = "MySQLdb"
+ self.connection_type = "pyPgSQL.PgSQL"
self.connection_dict = dict(cp_reconnect=True,
host=config.get("db", "host"),
user=config.get("db", "user"),
- passwd=config.get("db", "passwd"),
- db=config.get("db", "db"),
- port=config.getint("db", "port"),
- charset="utf8")
+ password=config.get("db", "passwd"),
+ database=config.get("db", "db"),
+ port=config.getint("db", "port"))
self.sm = ServiceManager()
self.dcm = DatabaseCommandManager()
Start up the connection to the database.
"""
if self.db is None:
- self.db = adbapi.ConnectionPool("MySQLdb", cp_reconnect=True,
+ self.db = adbapi.ConnectionPool("pyPgSQL.PgSQL", cp_reconnect=True,
host=config.get("db", "host"),
user=config.get("db", "user"),
- passwd=config.get("db", "passwd"),
- db=config.get("db", "db"),
+ password=config.get("db", "passwd"),
+ database=config.get("db", "db"),
port=config.getint("db", "port"))
def stop(self):