[Mpuls-commits] r2869 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 3 12:06:02 CEST 2010


Author: bh
Date: 2010-06-03 12:06:01 +0200 (Thu, 03 Jun 2010)
New Revision: 2869

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/base.py
   base/trunk/mpulsweb/lib/db.py
   base/trunk/mpulsweb/lib/security.py
Log:
* mpulsweb/lib/db.py (DB.__init__): Rename parameter and instance
variable dbname to database.  This is a bit less confusing,
because "dbname" is used in other parts of the MPuls code base for
the agency identifier used as part of the database name and the
database login names.  The new name is also exactly the name used
in the DB API connect call so that now all parameter that are
passed through to the connect call have the same names.
(DB.getConnection): Adapt to parameter/instance variable renaming

* mpulsweb/lib/security.py (checkLogin): Adapt to parameter
renaming in DB.__init__

* mpulsweb/lib/base.py (BaseController.__before__): Adapt to
parameter renaming in DB.__init__


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-06-03 10:03:31 UTC (rev 2868)
+++ base/trunk/ChangeLog	2010-06-03 10:06:01 UTC (rev 2869)
@@ -1,3 +1,20 @@
+2010-06-03  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/lib/db.py (DB.__init__): Rename parameter and instance
+	variable dbname to database.  This is a bit less confusing,
+	because "dbname" is used in other parts of the MPuls code base for
+	the agency identifier used as part of the database name and the
+	database login names.  The new name is also exactly the name used
+	in the DB API connect call so that now all parameter that are
+	passed through to the connect call have the same names.
+	(DB.getConnection): Adapt to parameter/instance variable renaming
+
+	* mpulsweb/lib/base.py (BaseController.__before__): Adapt to
+	parameter renaming in DB.__init__
+
+	* mpulsweb/lib/security.py (checkLogin): Adapt to parameter
+	renaming in DB.__init__
+
 2010-06-03  Torsten Irländer <torsten.irlaender at intevation.de>
 
 	* mpulsweb/controllers/evaluate.py

Modified: base/trunk/mpulsweb/lib/base.py
===================================================================
--- base/trunk/mpulsweb/lib/base.py	2010-06-03 10:03:31 UTC (rev 2868)
+++ base/trunk/mpulsweb/lib/base.py	2010-06-03 10:06:01 UTC (rev 2869)
@@ -156,7 +156,7 @@
                 userschema = config.get('mpuls.db.user')
                 dbschema = config.get('mpuls.db.database')
 
-            self.db = db.DB(dbname=dbschema% dbname,
+            self.db = db.DB(database=dbschema% dbname,
                             host=dbhost,
                             port=dbport,
                             user=userschema % (dbname, user.login),

Modified: base/trunk/mpulsweb/lib/db.py
===================================================================
--- base/trunk/mpulsweb/lib/db.py	2010-06-03 10:03:31 UTC (rev 2868)
+++ base/trunk/mpulsweb/lib/db.py	2010-06-03 10:06:01 UTC (rev 2869)
@@ -59,8 +59,8 @@
 
 class DB:
 
-    def __init__(self, dbname, user, password, host='localhost', port=5432):
-        self.dbname = dbname
+    def __init__(self, database, user, password, host='localhost', port=5432):
+        self.database = database
         self.user = user
         self.password = password.replace("\\", "\\\\")
         self.host = host
@@ -74,7 +74,7 @@
                 used[0] = True
                 return used[1]
 
-        con = dbapi.connect(database=self.dbname,
+        con = dbapi.connect(database=self.database,
                             host=self.host, port=self.port,
                             user=self.user, password=self.password)
         used = [True, con]

Modified: base/trunk/mpulsweb/lib/security.py
===================================================================
--- base/trunk/mpulsweb/lib/security.py	2010-06-03 10:03:31 UTC (rev 2868)
+++ base/trunk/mpulsweb/lib/security.py	2010-06-03 10:06:01 UTC (rev 2869)
@@ -106,7 +106,7 @@
 
     log.info('Login: user "%s" in "%s"' % (user, dbname))
     try:
-        mydb = DB(dbname=config.get('mpuls.db.database') % dbname,
+        mydb = DB(database=config.get('mpuls.db.database') % dbname,
                   host=config.get('mpuls.db.host'),
                   port=config.get('mpuls.db.port'),
                   user=config.get('mpuls.db.user') % (dbname, user),



More information about the Mpuls-commits mailing list