aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/globals.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-04-24 14:48:55 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-04-24 14:48:55 -0500
commitdf9809c2098d18b0272c40154b5e40d67b703214 (patch)
tree39f642a4614d036ddf5f2a67abc17009f97f299a /mediagoblin/globals.py
parent6bcab715b86dabe20aef7ba07960d50e4913ee15 (diff)
downloadmediagoblin-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/globals.py')
-rw-r--r--mediagoblin/globals.py24
1 files changed, 24 insertions, 0 deletions
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)