From df9809c2098d18b0272c40154b5e40d67b703214 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 24 Apr 2011 14:48:55 -0500 Subject: Make certain bits of info accessable as global variables from anywhere --- mediagoblin/globals.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 mediagoblin/globals.py (limited to 'mediagoblin/globals.py') diff --git a/mediagoblin/globals.py b/mediagoblin/globals.py new file mode 100644 index 00000000..59a94558 --- /dev/null +++ b/mediagoblin/globals.py @@ -0,0 +1,24 @@ +""" +In some places, we need to access the database, public_store, queue_store +""" + +############################# +# General mediagoblin globals +############################# + +# mongokit.Connection +db_connection = None + +# mongokit.Connection +database = None + +# should be the same as the +public_store = None +queue_store = None + + +def setup_globals(**kwargs): + from mediagoblin import globals as mg_globals + + for key, value in kwargs.iteritems(): + setattr(mg_globals, key, value) -- cgit v1.2.3