diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-04-24 14:48:55 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-04-24 14:48:55 -0500 |
commit | df9809c2098d18b0272c40154b5e40d67b703214 (patch) | |
tree | 39f642a4614d036ddf5f2a67abc17009f97f299a /mediagoblin/app.py | |
parent | 6bcab715b86dabe20aef7ba07960d50e4913ee15 (diff) | |
download | mediagoblin-df9809c2098d18b0272c40154b5e40d67b703214.tar.lz mediagoblin-df9809c2098d18b0272c40154b5e40d67b703214.tar.xz mediagoblin-df9809c2098d18b0272c40154b5e40d67b703214.zip |
Make certain bits of info accessable as global variables from anywhere
Diffstat (limited to 'mediagoblin/app.py')
-rw-r--r-- | mediagoblin/app.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mediagoblin/app.py b/mediagoblin/app.py index ae6db8f7..78ad19a4 100644 --- a/mediagoblin/app.py +++ b/mediagoblin/app.py @@ -21,6 +21,7 @@ import mongokit from webob import Request, exc from mediagoblin import routing, util, models, storage, staticdirect +from mediagoblin.globals import setup_globals class Error(Exception): pass @@ -53,6 +54,15 @@ class MediaGoblinApp(object): # set up staticdirector tool self.staticdirector = staticdirector + # certain properties need to be accessed globally eg from + # validators, etc, which might not access to the request + # object. + setup_globals( + db_connection=connection, + database=self.db, + public_store=self.public_store, + queue_store=self.queue_store) + def __call__(self, environ, start_response): request = Request(environ) path_info = request.path_info |