# HG changeset patch # User Sylvain Thénault # Date 1246865616 -7200 # Node ID efc6de279644798374aa6e8daf31d5818df838e5 # Parent 4c028cb136a4034d836da5a5c706a15bb2edd293 rename user to login where this is not a user object diff -r 4c028cb136a4 -r efc6de279644 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