Let setup_global_and_app_config call setup_globals
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Mon, 4 Jul 2011 22:02:04 +0000 (00:02 +0200)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Mon, 4 Jul 2011 22:02:04 +0000 (00:02 +0200)
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
mediagoblin/init/__init__.py

index 0ef670d7f54c87cc6c4e5dbf855a9f141508226d..6d6346d2ffa5d540a8c56b7bfe436d9eaccffafa 100644 (file)
@@ -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'],
index 4a14fdf8b83c71986aa9f9eea4004a58cd4ff822..1c34c5996b368e7e97ec908e676b8332dddfa18c 100644 (file)
@@ -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):