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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 4 10:32:31 CET 2010


Author: torsten
Date: 2010-02-04 10:32:30 +0100 (Thu, 04 Feb 2010)
New Revision: 1223

Added:
   wasko/branches/2.0/mpulsweb/lib/timelog.py
Removed:
   wasko/branches/2.0/waskaweb/lib/timelog.py
Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/mpulsweb/lib/base.py
   wasko/branches/2.0/waskaweb/lib/app_globals.py
Log:
Moved lib/timelog into base
* waskaweb/lib/timelog.py,
  mpulsweb/lib/timelog.py: Moved.
* waskaweb/lib/app_globals.py,
  mpulsweb/lib/base.py: Import from base now.


Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-02-04 09:20:16 UTC (rev 1222)
+++ wasko/branches/2.0/ChangeLog	2010-02-04 09:32:30 UTC (rev 1223)
@@ -1,5 +1,14 @@
 2010-02-04  Torsten Irländer <torsten.irlaender at intevation.de>
+	Moved lib/timelog into base
 
+	* waskaweb/lib/timelog.py,
+	  mpulsweb/lib/timelog.py: Moved.
+	* waskaweb/lib/app_globals.py,
+	  mpulsweb/lib/base.py: Import from base now.
+
+torsten at thoe:~/Projekte/mpuls/wasko/src/2.0
+2010-02-04  Torsten Irländer <torsten.irlaender at intevation.de>
+
 	Moved model/annotations into base
 
 	* waskaweb/model/annotations.py,

Modified: wasko/branches/2.0/mpulsweb/lib/base.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/base.py	2010-02-04 09:20:16 UTC (rev 1222)
+++ wasko/branches/2.0/mpulsweb/lib/base.py	2010-02-04 09:32:30 UTC (rev 1223)
@@ -40,9 +40,10 @@
 from pylons.i18n import _, ungettext, N_
 from pylons.templating import render
 
+import mpulsweb.lib.db as db
+from mpulsweb.lib.timelog import timeLog
+
 import waskaweb.lib.helpers as h
-import mpulsweb.lib.db as db
-from waskaweb.lib.timelog import timeLog
 from waskaweb.lib.security import HOST, PORT, DBNAME, USER, getDbName, \
      userIdentity
 

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


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

Modified: wasko/branches/2.0/waskaweb/lib/app_globals.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/app_globals.py	2010-02-04 09:20:16 UTC (rev 1222)
+++ wasko/branches/2.0/waskaweb/lib/app_globals.py	2010-02-04 09:32:30 UTC (rev 1223)
@@ -31,13 +31,12 @@
 
 from formed.meta.io.document import openDocument
 
+from mpulsweb.lib.timelog import setupTimeLogging
+from mpulsweb.model.annotations import AnnotationsProvider
+
 import waskaweb.lib.security as security
-from waskaweb.lib.timelog import setupTimeLogging
 from waskaweb.lib.config import MpulsConfig
 
-from mpulsweb.model.annotations import AnnotationsProvider
-
-
 log = logging.getLogger(__name__)
 
 

Deleted: wasko/branches/2.0/waskaweb/lib/timelog.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/timelog.py	2010-02-04 09:20:16 UTC (rev 1222)
+++ wasko/branches/2.0/waskaweb/lib/timelog.py	2010-02-04 09:32:30 UTC (rev 1223)
@@ -1,74 +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.
-# Authors:
-# Sascha L. Teichmann <teichmann at intevation.de>
-#
-
-import logging
-import logging.handlers as handlers
-
-from threading import Lock
-
-import sys
-
-MAX_TIME_LIST_LEN = 5
-
-__TIME_LOCK = Lock()
-
-__TIME_LIST = []
-
-__LOGGER = None
-
-def setupTimeLogging(host='localhost', port=handlers.DEFAULT_TCP_LOGGING_PORT):
-    if host: host = host.strip()
-    if host:
-        print >> sys.stderr, "time logging: %s port %d" % (host, port)
-        global __LOGGER 
-        __LOGGER = logging.getLogger('waska.timelog')
-        socketHandler = handlers.SocketHandler(host, port)
-        __LOGGER.addHandler(socketHandler)
-        __LOGGER.setLevel(logging.INFO)
-    else:
-        print >> sys.stderr, "time logging deactivated"
-
-def timeLog(t):
-    try:
-        __TIME_LOCK.acquire()
-        if __LOGGER is None:
-            return
-
-        if len(__TIME_LIST) < MAX_TIME_LIST_LEN-1:
-            __TIME_LIST.append(t)
-        else:
-            __TIME_LIST.append(t)
-            avg = float(sum(__TIME_LIST))/MAX_TIME_LIST_LEN
-            del __TIME_LIST[:]
-            __LOGGER.info("%f" % avg)
-    finally:
-        __TIME_LOCK.release()
-        
-
-# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list