Make certain bits of info accessable as global variables from anywhere
[mediagoblin.git] / mediagoblin / globals.py
1 """
2 In some places, we need to access the database, public_store, queue_store
3 """
4
5 #############################
6 # General mediagoblin globals
7 #############################
8
9 # mongokit.Connection
10 db_connection = None
11
12 # mongokit.Connection
13 database = None
14
15 # should be the same as the
16 public_store = None
17 queue_store = None
18
19
20 def setup_globals(**kwargs):
21 from mediagoblin import globals as mg_globals
22
23 for key, value in kwargs.iteritems():
24 setattr(mg_globals, key, value)