rename user to login where this is not a user object stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 06 Jul 2009 09:33:36 +0200
branchstable
changeset 2266 efc6de279644
parent 2265 4c028cb136a4
child 2267 e1d2df3f1091
rename user to login where this is not a user object
dbapi.py
--- a/dbapi.py	Mon Jul 06 09:33:09 2009 +0200
+++ b/dbapi.py	Mon Jul 06 09:33:36 2009 +0200
@@ -63,19 +63,19 @@
                                   'application' % nsid)
         return core.getProxyForURI(uri)
 
-def repo_connect(repo, user, password, cnxprops=None):
+def repo_connect(repo, login, password, cnxprops=None):
     """Constructor to create a new connection to the CubicWeb repository.
 
     Returns a Connection instance.
     """
     cnxprops = cnxprops or ConnectionProperties('inmemory')
-    cnxid = repo.connect(unicode(user), password, cnxprops=cnxprops)
+    cnxid = repo.connect(unicode(login), password, cnxprops=cnxprops)
     cnx = Connection(repo, cnxid, cnxprops)
     if cnxprops.cnxtype == 'inmemory':
         cnx.vreg = repo.vreg
     return cnx
 
-def connect(database=None, user=None, password=None, host=None,
+def connect(database=None, login=None, password=None, host=None,
             group=None, cnxprops=None, port=None, setvreg=True, mulcnx=True,
             initlog=True):
     """Constructor for creating a connection to the CubicWeb repository.
@@ -111,11 +111,11 @@
         vreg.set_schema(schema)
     else:
         vreg = None
-    cnx = repo_connect(repo, user, password, cnxprops)
+    cnx = repo_connect(repo, login, password, cnxprops)
     cnx.vreg = vreg
     return cnx
 
-def in_memory_cnx(config, user, password):
+def in_memory_cnx(config, login, password):
     """usefull method for testing and scripting to get a dbapi.Connection
     object connected to an in-memory repository instance
     """
@@ -128,7 +128,7 @@
     repo = get_repository('inmemory', config=config, vreg=vreg)
     # connection to the CubicWeb repository
     cnxprops = ConnectionProperties('inmemory')
-    cnx = repo_connect(repo, user, password, cnxprops=cnxprops)
+    cnx = repo_connect(repo, login, password, cnxprops=cnxprops)
     return repo, cnx