import pgdb at the last minute to avoid requiring pgdb at doc build time
authorMark Huang <mlhuang@cs.princeton.edu>
Fri, 27 Oct 2006 18:57:32 +0000 (18:57 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Fri, 27 Oct 2006 18:57:32 +0000 (18:57 +0000)
PLC/API.py

index a42e6c9..e3e084d 100644 (file)
@@ -5,7 +5,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 #
 # Copyright (C) 2004-2006 The Trustees of Princeton University
-# $Id: API.py,v 1.4 2006/10/13 20:00:21 mlhuang Exp $
+# $Id: API.py,v 1.5 2006/10/24 13:47:35 mlhuang Exp $
 #
 
 import sys
@@ -48,7 +48,6 @@ except ImportError:
     SOAPpy = None
 
 from PLC.Config import Config
-from PLC.PostgreSQL import PostgreSQL
 from PLC.Faults import *
 import PLC.Methods
 
@@ -67,6 +66,7 @@ class PLCAPI:
 
         # Initialize database connection
         if self.config.PLC_DB_TYPE == "postgresql":
+            from PLC.PostgreSQL import PostgreSQL
             self.db = PostgreSQL(self)
         else:
             raise PLCAPIError, "Unsupported database type " + config.PLC_DB_TYPE