[Mpuls-commits] r3382 - in jmd/trunk: . jmdstrukturweb/lib jmdweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Aug 11 17:16:00 CEST 2010


Author: bh
Date: 2010-08-11 17:15:58 +0200 (Wed, 11 Aug 2010)
New Revision: 3382

Added:
   jmd/trunk/jmdstrukturweb/lib/session.py
   jmd/trunk/jmdweb/lib/session.py
Modified:
   jmd/trunk/ChangeLog
Log:
* jmdstrukturweb/lib/session.py (MPulsSession): New.  Inherits
from MPulsSession from jmdweb to simply change the key_prefix to
"statistik".  The entry sharing is inherited from the base class.

* jmdweb/lib/session.py (MPulsSession): New.  Inherit from the
mpuls base class to override translate_key so that the AUTH and
USER_AUTHORIZED session entries can be shared between the case and
statistics parts of JMD.  Also uses "jmd" as the key prefix.


Modified: jmd/trunk/ChangeLog
===================================================================
--- jmd/trunk/ChangeLog	2010-08-11 15:03:41 UTC (rev 3381)
+++ jmd/trunk/ChangeLog	2010-08-11 15:15:58 UTC (rev 3382)
@@ -1,5 +1,16 @@
 2010-08-11  Bernhard Herzog  <bh at intevation.de>
 
+	* jmdweb/lib/session.py (MPulsSession): New.  Inherit from the
+	mpuls base class to override translate_key so that the AUTH and
+	USER_AUTHORIZED session entries can be shared between the case and
+	statistics parts of JMD.  Also uses "jmd" as the key prefix.
+
+	* jmdstrukturweb/lib/session.py (MPulsSession): New.  Inherits
+	from MPulsSession from jmdweb to simply change the key_prefix to
+	"statistik".  The entry sharing is inherited from the base class.
+
+2010-08-11  Bernhard Herzog  <bh at intevation.de>
+
 	* jmdweb/model/struktur.py: Import session from mpulsweb.lib.base
 	instead of from pylons in order to adapt to new mpuls conventions
 	that will allow us to keep the session data for the two different

Added: jmd/trunk/jmdstrukturweb/lib/session.py
===================================================================
--- jmd/trunk/jmdstrukturweb/lib/session.py	2010-08-11 15:03:41 UTC (rev 3381)
+++ jmd/trunk/jmdstrukturweb/lib/session.py	2010-08-11 15:15:58 UTC (rev 3382)
@@ -0,0 +1,8 @@
+from jmdweb.lib.session import MPulsSession as BaseSession
+
+
+class MPulsSession(BaseSession):
+
+    """Inherit from the JMD case specific wrapper and use a different prefix"""
+
+    key_prefix = "statistik"


Property changes on: jmd/trunk/jmdstrukturweb/lib/session.py
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: jmd/trunk/jmdweb/lib/session.py
===================================================================
--- jmd/trunk/jmdweb/lib/session.py	2010-08-11 15:03:41 UTC (rev 3381)
+++ jmd/trunk/jmdweb/lib/session.py	2010-08-11 15:15:58 UTC (rev 3382)
@@ -0,0 +1,19 @@
+from mpulsweb.lib.session import MPulsSession as BaseSession
+
+
+class MPulsSession(BaseSession):
+
+    """JMD specific session wrapper.
+
+    It extends the translate_key method so that the keys listed in the
+    no_prefix class variable are left as-is.  This way their values will
+    be shared among he case and statistics parts of JMD.
+    """
+
+    key_prefix = "jmd"
+    no_prefix = set(["AUTH", "USER_AUTHORIZED"])
+
+    def translate_key(self, key):
+        if key in self.no_prefix:
+            return key
+        return BaseSession.translate_key(self, key)


Property changes on: jmd/trunk/jmdweb/lib/session.py
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native



More information about the Mpuls-commits mailing list