[CalendarServer-changes] [14497] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 3 13:48:55 PST 2015


Revision: 14497
          http://trac.calendarserver.org//changeset/14497
Author:   wsanchez at apple.com
Date:     2015-03-03 13:48:54 -0800 (Tue, 03 Mar 2015)
Log Message:
-----------
import postgres module via subprogres.py

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tap/util.py
    CalendarServer/trunk/twistedcaldav/database.py
    CalendarServer/trunk/twistedcaldav/directory/calendaruserproxy.py
    CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py

Modified: CalendarServer/trunk/calendarserver/tap/util.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/util.py	2015-03-03 20:45:43 UTC (rev 14496)
+++ CalendarServer/trunk/calendarserver/tap/util.py	2015-03-03 21:48:54 UTC (rev 14497)
@@ -161,8 +161,8 @@
     """
     Create a postgres DB-API connector from the given configuration.
     """
-    import pgdb
-    return DBAPIConnector(pgdb, postgresPreflight, config.DSN).connect
+    from txdav.base.datastore.subpostgres import postgres
+    return DBAPIConnector(postgres, postgresPreflight, config.DSN).connect
 
 
 

Modified: CalendarServer/trunk/twistedcaldav/database.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/database.py	2015-03-03 20:45:43 UTC (rev 14496)
+++ CalendarServer/trunk/twistedcaldav/database.py	2015-03-03 21:48:54 UTC (rev 14497)
@@ -14,11 +14,19 @@
 # limitations under the License.
 ##
 
+"""
+Generic ADAPI database access object.
+"""
+
+__all__ = [
+    "AbstractADBAPIDatabase",
+]
+
 import thread
 
 try:
-    import pgdb as postgres
-except:
+    from txdav.base.datastore.subpostgres import postgres
+except ImportError:
     postgres = None
 
 from twisted.enterprise.adbapi import ConnectionPool
@@ -29,15 +37,9 @@
 
 from twistedcaldav.config import ConfigurationError
 
-"""
-Generic ADAPI database access object.
-"""
+log = Logger()
 
-__all__ = [
-    "AbstractADBAPIDatabase",
-]
 
-log = Logger()
 
 class ConnectionClosingThreadPool(ThreadPool):
     """

Modified: CalendarServer/trunk/twistedcaldav/directory/calendaruserproxy.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/calendaruserproxy.py	2015-03-03 20:45:43 UTC (rev 14496)
+++ CalendarServer/trunk/twistedcaldav/directory/calendaruserproxy.py	2015-03-03 21:48:54 UTC (rev 14497)
@@ -873,9 +873,13 @@
     """
 
     def __init__(self, host, database, user=None, password=None, dbtype=None):
+        from txdav.base.datastore.subpostgres import postgres
 
         ADBAPIPostgreSQLMixin.__init__(self,)
-        ProxyDB.__init__(self, "Proxies", "pgdb", (), host=host, database=database, user=user, password=password,)
+        ProxyDB.__init__(
+            self, "Proxies", postgres.__name__, (),
+            host=host, database=database, user=user, password=password,
+        )
         if dbtype:
             ProxyDB.schema_type = dbtype
 

Modified: CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py	2015-03-03 20:45:43 UTC (rev 14496)
+++ CalendarServer/trunk/twistedcaldav/directory/test/test_proxyprincipaldb.py	2015-03-03 21:48:54 UTC (rev 14497)
@@ -598,7 +598,7 @@
 
 
 try:
-    import pgdb as postgres
+    from txdav.base.datastore.subpostgres import postgres
 except ImportError:
     ProxyPrincipalDBPostgreSQL.skip = True
 else:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150303/43f4a47c/attachment.html>


More information about the calendarserver-changes mailing list