min=0 makes more sense than min=-1
[mediagoblin.git] / mediagoblin / globals.py
CommitLineData
df9809c2
CAW
1"""
2In some places, we need to access the database, public_store, queue_store
3"""
4
b77eec65
CAW
5import gettext
6import pkg_resources
7
df9809c2
CAW
8#############################
9# General mediagoblin globals
10#############################
11
12# mongokit.Connection
13db_connection = None
14
15# mongokit.Connection
16database = None
17
18# should be the same as the
19public_store = None
20queue_store = None
21
b77eec65
CAW
22# gettext
23translations = gettext.find(
24 'mediagoblin',
25 pkg_resources.resource_filename(
26 'mediagoblin', 'translations'), ['en'])
27
df9809c2
CAW
28
29def setup_globals(**kwargs):
30 from mediagoblin import globals as mg_globals
31
32 for key, value in kwargs.iteritems():
33 setattr(mg_globals, key, value)