[Mpuls-commits] r1233 - in wasko/branches/2.0: . mpulsweb/lib waskaweb/config waskaweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Feb 4 11:27:04 CET 2010
Author: torsten
Date: 2010-02-04 11:27:02 +0100 (Thu, 04 Feb 2010)
New Revision: 1233
Added:
wasko/branches/2.0/mpulsweb/lib/app_globals.py
Removed:
wasko/branches/2.0/waskaweb/lib/app_globals.py
Modified:
wasko/branches/2.0/ChangeLog
wasko/branches/2.0/waskaweb/config/environment.py
Log:
Moved lib/app_globals into base
* waskaweb/lib/app_globals.py,
mpulsweb/lib/app_globals.py: Moved file.
* waskaweb/config/environment.py: Changed import.
Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog 2010-02-04 10:23:40 UTC (rev 1232)
+++ wasko/branches/2.0/ChangeLog 2010-02-04 10:27:02 UTC (rev 1233)
@@ -1,5 +1,13 @@
2010-02-04 Torsten Irländer <torsten.irlaender at intevation.de>
+ Moved lib/app_globals into base
+
+ * waskaweb/lib/app_globals.py,
+ mpulsweb/lib/app_globals.py: Moved file.
+ * waskaweb/config/environment.py: Changed import.
+
+2010-02-04 Torsten Irländer <torsten.irlaender at intevation.de>
+
Moved lib/security into base
* mpulsweb/lib/security.py,
Copied: wasko/branches/2.0/mpulsweb/lib/app_globals.py (from rev 1232, wasko/branches/2.0/waskaweb/lib/app_globals.py)
Property changes on: wasko/branches/2.0/mpulsweb/lib/app_globals.py
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: wasko/branches/2.0/waskaweb/config/environment.py
===================================================================
--- wasko/branches/2.0/waskaweb/config/environment.py 2010-02-04 10:23:40 UTC (rev 1232)
+++ wasko/branches/2.0/waskaweb/config/environment.py 2010-02-04 10:27:02 UTC (rev 1233)
@@ -30,7 +30,7 @@
from mako.lookup import TemplateLookup
from pylons import config
-import waskaweb.lib.app_globals as app_globals
+import mpulsweb.lib.app_globals as app_globals
import waskaweb.lib.helpers
from waskaweb.config.routing import make_map
Deleted: wasko/branches/2.0/waskaweb/lib/app_globals.py
===================================================================
--- wasko/branches/2.0/waskaweb/lib/app_globals.py 2010-02-04 10:23:40 UTC (rev 1232)
+++ wasko/branches/2.0/waskaweb/lib/app_globals.py 2010-02-04 10:27:02 UTC (rev 1233)
@@ -1,100 +0,0 @@
-# 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.
-
-"""The application's Globals object"""
-
-import os
-import logging
-
-from pylons import config
-
-from formed.meta.io.document import openDocument
-
-from mpulsweb.lib.timelog import setupTimeLogging
-from mpulsweb.lib.config import MpulsConfig
-from mpulsweb.lib.security import load_db_mapping_from_file
-from mpulsweb.model.annotations import AnnotationsProvider
-
-
-log = logging.getLogger(__name__)
-
-
-class Globals(object):
-
- """Globals acts as a container for objects available throughout the
- life of the application
- """
-
- def __init__(self):
- """One instance of Globals is created during application
- initialization and is available during requests via the 'g'
- variable
- """
- # Load mpuls configuration
- config_file = config.get('mpuls.app.config', 'default.json')
- if not os.path.isabs(config_file):
- root = config.get('pylons.paths').get('root')
- config_file = os.path.join(root, '..', config_file)
-
- self.config_path = os.path.dirname(config_file)
- self.mpuls_config = MpulsConfig(config_file)
-
- public_dir = config.get('pylons.paths').get('static_files')
- formed_dir = os.path.join(public_dir, "formed")
- formed_file = os.path.join(formed_dir,
- self.mpuls_config.get('formed', 'treefile'))
- annotation_file = os.path.join(formed_dir,
- self.mpuls_config.get('formed',
- 'annotation'))
-
- # Build FormedTree. This tree will work as template for all cases
- self.formedTree = openDocument(formed_file)
- try:
- self.helpData = AnnotationsProvider(annotation_file)
- except:
- # annotations are optional
- # FIXME: it would be better to distinguish between a missing
- # file and parse errors.
- log.exception("Could not open helpfile %r", annotation_file)
-
-
- # TODO: These setups should be while application intialisation, as they
- # are not related to any global vars or functions. Move to
- # config/environment.py
-
- # set time logging
- time_host = config.get('time_host')
- time_port = config.get('time_port')
-
- if time_host and time_port:
- setupTimeLogging(time_host, int(time_port))
- elif time_host:
- setupTimeLogging(int(time_host))
-
- # File to remap database name
- mapping_file = config.get('db_mapping_file')
-
- if mapping_file:
- load_db_mapping_from_file(mapping_file)
-
More information about the Mpuls-commits
mailing list