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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Nov 18 18:07:28 CET 2011


Author: bh
Date: 2011-11-18 18:07:10 +0100 (Fri, 18 Nov 2011)
New Revision: 5611

Modified:
   base/trunk/mpulsweb/controllers/logbook.py
Log:
Fix formatting. Remove commented out code.


Modified: base/trunk/mpulsweb/controllers/logbook.py
===================================================================
--- base/trunk/mpulsweb/controllers/logbook.py	2011-11-18 16:47:58 UTC (rev 5610)
+++ base/trunk/mpulsweb/controllers/logbook.py	2011-11-18 17:07:10 UTC (rev 5611)
@@ -1,27 +1,27 @@
 # -*- coding: utf-8 -*-
 #
 # Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
-# 
-# This file is part of mpuls WASKA (CoMPUter-based case fiLeS - 
+#
+# This file is part of mpuls WASKA (CoMPUter-based case fiLeS -
 # Web-Anwendungs-Server fuer Kompetenzagenturen).
-# 
+#
 # mpuls WASKA is free software: you can redistribute it and/or modify it under
 # the terms of the GNU Affero General Public License as published by the
 # Free Software Foundation, either version 3 of the License, or (at your
 # option) any later version.
-# 
+#
 # mpuls WASKA is distributed in the hope that it will be useful, but WITHOUT
 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
 # License for more details.
-# 
+#
 # You should have received a copy of the GNU Affero General Public
 # License along with mpuls WASKA. If not, see <http://www.gnu.org/licenses/>.
-# 
-# mpuls WASKA has been developed on behalf of the 
+#
+# mpuls WASKA has been developed on behalf of the
 # Projekttraeger im Deutschen Zentrum fuer Luft- und Raumfahrt e.V. (PT-DLR)
 # within the programme Kompetenzagenturen (Durchfuehrungsphase) funded by
-# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and 
+# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and
 # European Social Fund resources.
 
 import sys
@@ -48,6 +48,7 @@
     order = params.get('sort_order', 'asc')
     return sort, order
 
+
 class LogbookController(BaseController):
 
     @checkRole(('cm'))
@@ -66,7 +67,7 @@
         ## Build evaluations
         c.eval_effort = logbook.getEvaluation()
         c.eval_typ_effort = logbook.getTypEvaluation()
-        
+
         return render('/logbook/overview.mako')
 
     @checkRole(('cm'))
@@ -77,7 +78,8 @@
             entry.loadById(id)
         except Exception, e:
             c.failed_for = _(u"Showing of logbook entry failed!")
-            c.failed_text =  _(u"An error occured while showing the logbook entry.")
+            c.failed_text = _(u"An error occured while showing the logbook"
+                              u" entry.")
             c.url_ok = url_for(controller='/logbook', action='index',
                                id=session['case'].id)
             log.exception(e)
@@ -129,11 +131,6 @@
                                               auto_insert_errors=False,
                                               errors=c.form_errors)
 
-        #if checker.hasErrors():
-        #    c.ds_id           = session['case'].id
-        #    c.entry           = checker.getLogbookEntry()
-        #    c.form_errors     = checker.getErrors()
-
         try:
             log.debug("New Logbook entry from case %s" % checker.getCaseId())
             logbook = Logbook(checker.getCaseId())
@@ -148,7 +145,8 @@
         except:
             traceback.print_exc(file=sys.stderr)
             c.failed_for = _(u"Logbook entry was not created!")
-            c.failed_text = _(u"An error occured while creating a logbook entry")
+            c.failed_text = _(u"An error occured while creating a logbook"
+                              u" entry")
             c.url_ok = url_for(controller='/case', action='logbook',
                                id=session['case'].id)
             return render('/logbook/dialogs/failed_create_logbook_entry.mako')
@@ -178,8 +176,9 @@
                                               errors={})
         except Exception, e:
             log.exception(e)
-            c.failed_for =  _(u"Showing of logbook entry failed!")
-            c.failed_text = _(u"An error occured while showing the logbook entry.")
+            c.failed_for = _(u"Showing of logbook entry failed!")
+            c.failed_text = _(u"An error occured while showing the logbook"
+                              u" entry.")
             c.url_ok = url_for(controller='/logbook', action='index',
                                id=session['case'].id)
             return render('/logbook/dialogs/failed_show_logbook_entry.mako')
@@ -202,26 +201,22 @@
                                               auto_insert_errors=False,
                                               errors=c.form_errors)
 
-        #if checker.hasErrors():
-        #    c.errors = checker.getErrors()
-        #    c.entry  = checker.getLogbookEntry()
-        #    c.entry.setId(id)
-        #    return render('/logbook/edit.mako')
-
         try:
             entry = checker.getLogbookEntry()
             entry.setId(id)
             entry.storeForUser(session['USER_AUTHORIZED'].id)
 
             c.success_for = _(u"Changes on logbook successfull!")
-            c.success_text = _(u"The changes on the logbook entry were applied successfully.")
+            c.success_text = _(u"The changes on the logbook entry were"
+                               u" applied successfully.")
             c.url_ok = url_for(controller='/logbook', action='index',
                                id=session['case'].id)
             return render('/logbook/dialogs/success_save_logbook_entry.mako')
         except Exception, e:
             log.exception(e)
             c.failed_for = _(u"Changes on logbook failed!")
-            c.failed_text = _(u"An error occured applying changes on the logbook entry")
+            c.failed_text = _(u"An error occured applying changes on the"
+                              u" logbook entry")
             c.url_ok = url_for(controller='/logbook', action='index',
                                id=session['case'].id)
             return render('/logbook/dialogs/failed_save_logbook_entry.mako')
@@ -241,14 +236,15 @@
             except Exception, e:
                 log.exception(e)
                 c.failed_for = _(u"Deletion of logbook entry failed!")
-                c.failed_text = _(u"An error occured while deleting the logbook entry.")
+                c.failed_text = _(u"An error occured while deleting the"
+                                  u" logbook entry.")
                 c.url_ok = url_for(controller='/logbook', action='index',
                                    id=session['case'].id)
                 return render('/logbook/dialogs/failed_delete_logbook_entry.mako')
         else:
             c.confirm_for = _(u"Delete logbook entry?")
-            c.question = _(u"""Do you want to delete this logbook entry?
-The data will be irrevocably lost.""")
+            c.question = _(u"Do you want to delete this logbook entry?\n"
+                           u"The data will be irrevocably lost.")
             c.url_yes = url_for(controller='/logbook', action='delete', id=id,
                                 confirmed=1)
             c.url_no = url_for(controller='/logbook', action='index',
@@ -259,18 +255,18 @@
     def printout(self, id):
         id = self._checkInt(id)
         c.print_version = 1
-        
+
         # Load logbook
         logbook = Logbook()
         logbook.loadById(id)
         c.logbook = logbook
-        
+
         # Load case
         case = self._loadCase(logbook.getMasterId())
         c.case = case
-        
+
         return render('/logbook/overview_print.mako')
-    
-    
 
+
+
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list