[Mpuls-commits] r2247 - in wasko/branches/2.0: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Mar 29 18:09:11 CEST 2010


Author: bh
Date: 2010-03-29 18:09:11 +0200 (Mon, 29 Mar 2010)
New Revision: 2247

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/mpulsweb/lib/base.py
Log:
* mpulsweb/lib/base.py: Fix formatting.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-03-29 16:05:38 UTC (rev 2246)
+++ wasko/branches/2.0/ChangeLog	2010-03-29 16:09:11 UTC (rev 2247)
@@ -1,5 +1,9 @@
 2010-03-29  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/base.py: Fix formatting.
+
+2010-03-29  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/config.py: Fix formatting.
 
 2010-03-29  Bernhard Herzog  <bh at intevation.de>

Modified: wasko/branches/2.0/mpulsweb/lib/base.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/base.py	2010-03-29 16:05:38 UTC (rev 2246)
+++ wasko/branches/2.0/mpulsweb/lib/base.py	2010-03-29 16:09:11 UTC (rev 2247)
@@ -85,27 +85,27 @@
                 shared = request.cookies['mpuls_auth']
             except KeyError:
                 log.error("Cannot find mpuls_auth cookie -> HTTPUnauthorized")
-                raise HTTPUnauthorized(detail = COOKIE_NOT_FOUND)
+                raise HTTPUnauthorized(detail=COOKIE_NOT_FOUND)
 
             if storedHash != md5.new(shared + userIdentity()).digest():
                 log.error("Stored hash does't match new hash "
                           "-> HTTPUnauthorized")
-                raise HTTPUnauthorized(detail = IDENTITY_CHANGED)
+                raise HTTPUnauthorized(detail=IDENTITY_CHANGED)
         except KeyError:
             pass
 
-        # Set language for translation based an browser setting. Default locales. 
+        # Set language for translation based an browser setting. Default
+        # locales.
         # TODO: pylons.i18n.translation (_get_translator) still tries to load
         # language files for "waskaweb". It seems to be defined in
         # conf['pylons.package']. I do not know how this var gets set during
         # application init.
         deflang = locale.getlocale()[0]
         for lang in request.languages:
-
             try:
                 log.debug('Trying to set lang to %s' % lang)
                 set_lang(lang)
-                break;
+                break
             except Exception, e:
                 log.debug('Can not set lang to %s' % lang)
         else:
@@ -127,21 +127,22 @@
             self.db = db.DB(dbname=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.login),
+                            user=config.get('mpuls.db.user') % (dbname,
+                                                                user.login),
                             password=user.password)
             db.enter(self.db)
 
             # Is the user activated?
             log.debug('User accound activated: %s' % user.isActivated())
             log.debug('User needs new pass: %s' % user.needsNewPass())
-            if (not user.isActivated() and \
+            if (not user.isActivated() and
                 request.path not in ['/auth/accountDeactivated']):
                 redirect_to('/auth/accountDeactivated')
 
             # Do the user needs to change his passwort?
-            elif (user.needsNewPass() and \
-                request.path not in ['/usersettings/changePasswordOnLogin', 
-                    '/usersettings/changePasswordOnLoginAction']):
+            elif (user.needsNewPass() and
+                  request.path not in ['/usersettings/changePasswordOnLogin',
+                                  '/usersettings/changePasswordOnLoginAction']):
                 redirect_to('/usersettings/changePasswordOnLogin')
 
         except KeyError:



More information about the Mpuls-commits mailing list