From cca5d55d40fe5b4f097e015c72cbd8e6c4c3232a Mon Sep 17 00:00:00 2001 From: Elrond Date: Tue, 5 Jul 2011 00:02:04 +0200 Subject: [PATCH] Let setup_global_and_app_config call setup_globals Let setup_global_and_app_config set the global and app config in the mg_globals already. This way, the config is available to everyone very early. --- mediagoblin/app.py | 3 --- mediagoblin/init/__init__.py | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mediagoblin/app.py b/mediagoblin/app.py index 0ef670d7..6d6346d2 100644 --- a/mediagoblin/app.py +++ b/mediagoblin/app.py @@ -94,9 +94,6 @@ class MediaGoblinApp(object): ####################################################### setup_globals( - app_config=app_config, - global_config=global_config, - # TODO: No need to set these two up as globals, we could # just read them out of mg_globals.app_config email_sender_address=app_config['email_sender_address'], diff --git a/mediagoblin/init/__init__.py b/mediagoblin/init/__init__.py index 4a14fdf8..1c34c599 100644 --- a/mediagoblin/init/__init__.py +++ b/mediagoblin/init/__init__.py @@ -18,6 +18,7 @@ import jinja2 from mediagoblin import staticdirect from mediagoblin.init.config import ( read_mediagoblin_config, generate_validation_report) +from mediagoblin.mg_globals import setup_globals class Error(Exception): pass @@ -33,6 +34,10 @@ def setup_global_and_app_config(config_path): if validation_report: raise ImproperlyConfigured(validation_report) + setup_globals( + app_config=app_config, + global_config=global_config) + return global_config, app_config def get_jinja_loader(user_template_path=None): -- 2.25.1