[Mpuls-commits] r5620 - base/trunk/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Nov 18 21:21:23 CET 2011


Author: bh
Date: 2011-11-18 21:21:16 +0100 (Fri, 18 Nov 2011)
New Revision: 5620

Modified:
   base/trunk/mpulsweb/controllers/formularpage.py
Log:
Fix formatting.
This changes the whitespace in some internationalized strings, so the
pot and po files need to be updated.


Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py	2011-11-18 19:54:18 UTC (rev 5619)
+++ base/trunk/mpulsweb/controllers/formularpage.py	2011-11-18 20:21:16 UTC (rev 5620)
@@ -14,17 +14,15 @@
 from mpulsweb.lib.translation import _
 from mpulsweb.lib.security import checkRole
 from mpulsweb.lib.db import  PostgresDBInterface
-from mpulsweb.lib.navigation import  mark_folderopen, \
-        get_navigation
-
+from mpulsweb.lib.navigation import mark_folderopen, get_navigation
 from mpulsweb.lib.base import BaseController, render, session
 from mpulsweb.lib.helpers import url_for, literal
+from mpulsweb.lib.formedrenderer import ViewRenderer, ViewPrintRenderer, \
+        UrlFactory
+
 from mpulsweb.model.phase import PhaseFactory, PC_MANUAL, PC_FULLAUTO
 
-from mpulsweb.lib.formedrenderer import ViewRenderer,ViewPrintRenderer, \
-        UrlFactory
 
-
 log = logging.getLogger(__name__)
 
 
@@ -166,11 +164,11 @@
             # uncommitted fields data stored in the session.
             pass
         session['uncommited_fields'] = instance_tree.commit()
-        
+
         if session['navigation.tree'].getTreeItem(page_id).parent_repeat():
             session['navigation.tree'] = get_navigation(
-                                         case_id,
-                                         session['navigation.openfolders'])
+                case_id,
+                session['navigation.openfolders'])
         session.save()
 
         # How to proceed after saving the data?
@@ -208,15 +206,19 @@
     def _handle_automatic_phase_change(self, page_id):
         """Change Phase automatically depending on the state of the case"""
 
-        DIALOG_FULLAUTOMATIC_CHANGE_TITLE=_("Phase automatically changed")
-        DIALOG_FULLAUTOMATIC_CHANGE_TEXT=_("The phase of the case was changed automatically \
-            after checking the filled out required fields. The phase changed from '%s' to '%s'. \
-            Please click on 'Ok', to proceed editing the case.")
-        DIALOG_HALFAUTOMATIC_CHANGE_TITLE=_("Change phase?")
-        DIALOG_HALFAUTOMATIC_CHANGE_TEXT=_("After checking the filled out required fields, it \
-            seems that a phase change can be done from phase '%s' to '%s'. Please click on 'Yes' \
-            to perform the change. Click on 'No' to perform the change later manually on \
-            the phase overview page.")
+        fullautomatic_title = _("Phase automatically changed")
+        fullautomatic_text = _("The phase of the case was changed automatically"
+                               " after checking the filled out required fields."
+                               " The phase changed from '%s' to '%s'."
+                               " Please click on 'Ok', to proceed editing"
+                               " the case.")
+        halfautomatic_title = _("Change phase?")
+        halfautomatic_text = _("After checking the filled out required fields,"
+                               " it seems that a phase change can be done from"
+                               " phase '%s' to '%s'."
+                               " Please click on 'Yes' to perform the change."
+                               " Click on 'No' to perform the change later"
+                               " manually on the phase overview page.")
 
         changemode = g.mpuls_config.get('phases', 'changemode')
         if changemode != PC_MANUAL:
@@ -231,22 +233,20 @@
                 rpd = phases.get_phase(reachable_phase).getDescription()
                 if changemode == PC_FULLAUTO:
                     log.debug("fullautomatic phase change!")
-                    #load case and set phase
+                    # load case and set phase
                     case = g.case_factory.loadById(session['case'].id)
                     case.setPhase(reachable_phase)
                     # build dialog
-                    c.dialog_title = DIALOG_FULLAUTOMATIC_CHANGE_TITLE
-                    c.dialog_text = literal((DIALOG_FULLAUTOMATIC_CHANGE_TEXT
-                                             % (cpd, rpd)))
+                    c.dialog_title = fullautomatic_title
+                    c.dialog_text = literal((fullautomatic_text % (cpd, rpd)))
                     c.url_ok = url_for(controller="formularpage",
                                        action="select", id=page_id)
                     return render('/phase/dialogs/success_fullautomatic_set_phase.mako')
                 else:
                     log.debug("halfautomatic phase change!")
                     # build dialog
-                    c.dialog_title = DIALOG_HALFAUTOMATIC_CHANGE_TITLE
-                    c.dialog_text = literal((DIALOG_HALFAUTOMATIC_CHANGE_TEXT
-                                             % (cpd, rpd)))
+                    c.dialog_title = halfautomatic_title
+                    c.dialog_text = literal((halfautomatic_text % (cpd, rpd)))
                     c.url_ok = url_for(controller="phase", action="setPhase",
                                        id=session['case'].id,
                                        value=reachable_phase)



More information about the Mpuls-commits mailing list