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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Feb 16 11:08:34 CET 2010


Author: torsten
Date: 2010-02-16 11:08:31 +0100 (Tue, 16 Feb 2010)
New Revision: 1596

Added:
   wasko/branches/2.0/mpulsweb/lib/evaluation.py
Removed:
   wasko/branches/2.0/waskaweb/lib/evaluation.py
Modified:
   wasko/branches/2.0/ChangeLog
Log:
Moved lib.evaluation to mpulsweb


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-16 10:08:05 UTC (rev 1595)
+++ wasko/branches/2.0/ChangeLog	2010-02-16 10:08:31 UTC (rev 1596)
@@ -16,6 +16,10 @@
 	not used anywhere.
 	* wasko.json: Added logbook configuration to wasko.json config file.
 
+	* mpulsweb/lib/evaluation.py,
+	  waskaweb/lib/evaluation.py: Moved evaluation to mpulsweb.
+	* waskaweb/model/logbook.py: Import evaluation from mpulsweb now.
+
 2010-02-15  Bernhard Herzog  <bh at intevation.de>
 
 	* waskaweb/controllers/evaluate.py: The base package is called

Copied: wasko/branches/2.0/mpulsweb/lib/evaluation.py (from rev 1589, wasko/branches/2.0/waskaweb/lib/evaluation.py)


Property changes on: wasko/branches/2.0/mpulsweb/lib/evaluation.py
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: wasko/branches/2.0/waskaweb/lib/evaluation.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/evaluation.py	2010-02-16 10:08:05 UTC (rev 1595)
+++ wasko/branches/2.0/waskaweb/lib/evaluation.py	2010-02-16 10:08:31 UTC (rev 1596)
@@ -1,93 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
-# 
-# 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 
-# 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 
-# European Social Fund resources.
-
-
-from pylons import app_globals as g
-
-from mpulsweb.lib.helpers import timedelta_in_minutes 
-from mpulsweb.lib.db import db
-
-class LogbookEvaluation:
-    """Zeitaufwände aus dem Logbuch aller Fälle"""
-    def __init__(self, id):
-        self.sql  = """SELECT sum(coalesce(l.dauer, '0 second'::interval)) AS dauer, count(l.id) AS anzahl, l.art, m.id
-            FROM ka_logbuch_tbl_view l
-            JOIN master_tbl_eval_total_view m
-            ON m.id = l.master_id
-            WHERE l.master_id = %s
-            AND l.art <> '0'
-            GROUP BY l.art, m.id 
-            ORDER BY l.art
-        """ % id
-
-    def perform(self):
-        unique_cases = []
-        result = {}
-        for num, category in enumerate(g.mpuls_config.get('logbook', 'categories')):
-            for item in category.get('items'):
-                result[item] = [0,0]
-            result['sum_cat%s' % num] = [0,0]
-        result['sum_all']= [0,0]
-        try:
-            try:
-                conn = db.getConnection()
-                cur  = conn.cursor()
-                cur.execute(self.sql)
-                count = 0
-                while True:
-                    row = cur.fetchone()
-                    if not row: break
-
-                    if row[3] not in unique_cases:
-                        count += 1
-                        unique_cases.append(row[3])
-
-                    duration = int(timedelta_in_minutes(row[0]))
-                    num      = row[1]
-                    type     = str(row[2])
-
-                    result[type][0] += num
-                    result[type][1] += duration
-        
-                    # Search category of the item and sum num and duration
-                    for cnum, category in enumerate(
-                        g.mpuls_config.get('logbook', 'categories')):
-
-                        if type in category.get('items'):
-                            result['sum_cat%s' % cnum][0] += num 
-                            result['sum_cat%s' % cnum][1] += int(duration)
-                            break;
-
-                    result['sum_all'][0] += num
-                    result['sum_all'][1] += int(duration)
-
-                return result
-            except StandardError, e:
-                log.exception(e)
-                raise
-        finally:
-            db.recycleConnection(conn, cur)
-
-# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list