]> git.etc.gen.nz Git - whoisi.git/commitdiff
Switch to PostgreSQL.
authorAndrew Ruthven <andrew@etc.gen.nz>
Mon, 22 Jun 2009 09:44:31 +0000 (21:44 +1200)
committerAndrew Ruthven <andrew@etc.gen.nz>
Mon, 22 Jun 2009 09:44:31 +0000 (21:44 +1200)
publisher-service

index abde231ddc4a5a6e16a38115e6bc7f1f7f91d649..f41f5772be5ea741f328d194c0dca9be10a0f511 100755 (executable)
@@ -79,16 +79,15 @@ class MasterConnectionController(pb.Root):
 
 dcm = None
 
-def mysql_service_setup():
+def db_service_setup():
     global dcm
-    connection_type = "MySQLdb"
+    connection_type = "pyscopg2"
     connection_dict = dict(cp_reconnect=True,
                            host=config.get("db", "host"),
-                           user=config.get("db", "user"),
-                           passwd=config.get("db", "passwd"),
+                           username=config.get("db", "user"),
+                           password=config.get("db", "passwd"),
                            db=config.get("db", "db"),
-                           port=config.getint("db", "port"),
-                           charset="utf8")
+                           port=config.getint("db", "port"))
 
     dcm = DatabaseCommandManager()
     dcm.start(connection_type, connection_dict)
@@ -123,7 +122,7 @@ port = config.getint("listen", "port")
 client_port = config.getint("client-listen", "port")
 
 # set up the database
-mysql_service_setup()
+db_service_setup()
 
 # Set up our main service that glues everything together
 ps = PublisherService()