aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/mg_globals.py
blob: 2fca3c0ac1c5cd55d2c12acba09dd048a75070d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
In some places, we need to access the database, public_store, queue_store
"""

import gettext
import pkg_resources

#############################
# General mediagoblin globals
#############################

# mongokit.Connection
db_connection = None

# mongokit.Connection
database = None

# should be the same as the 
public_store = None
queue_store = None

# gettext
translations = gettext.find(
    'mediagoblin',
    pkg_resources.resource_filename(
    'mediagoblin', 'translations'), ['en'])


def setup_globals(**kwargs):
    from mediagoblin import mg_globals

    for key, value in kwargs.iteritems():
        setattr(mg_globals, key, value)