dbapi.py
changeset 7006 d0f635d3a6bb
parent 6848 f87cd875c6db
parent 7004 9e142116d82f
child 7061 bb2080547722
--- a/dbapi.py	Thu Feb 17 10:26:50 2011 +0100
+++ b/dbapi.py	Thu Feb 17 16:09:06 2011 +0100
@@ -168,16 +168,20 @@
       where it's already initialized.
 
     :kwargs:
-      there goes authentication tokens. You usually have to specify for
-      instance a password for the given user, using a named 'password' argument.
+      there goes authentication tokens. You usually have to specify a password
+      for the given user, using a named 'password' argument.
     """
-    config = cwconfig.CubicWebNoAppConfiguration()
-    if host:
-        config.global_set_option('pyro-ns-host', host)
-    if group:
-        config.global_set_option('pyro-ns-group', group)
     cnxprops = cnxprops or ConnectionProperties()
     method = cnxprops.cnxtype
+    if method == 'pyro':
+        config = cwconfig.CubicWebNoAppConfiguration()
+        if host:
+            config.global_set_option('pyro-ns-host', host)
+        if group:
+            config.global_set_option('pyro-ns-group', group)
+    else:
+        assert database
+        config = cwconfig.instance_configuration(database)
     repo = get_repository(method, database, config=config)
     if method == 'inmemory':
         vreg = repo.vreg