Put some space between the gallery and the rest of the page content
[mediagoblin.git] / mediagoblin / mg_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
218b8124 8
df9809c2
CAW
9#############################
10# General mediagoblin globals
11#############################
12
13# mongokit.Connection
14db_connection = None
15
16# mongokit.Connection
17database = None
18
19# should be the same as the
20public_store = None
21queue_store = None
22
49285baf
E
23# Dump mail to stdout instead of sending it:
24email_debug_mode = False
25
26# Address for sending out mails
27email_sender_address = None
28
29# A WorkBenchManager
30workbench_manager = None
31
b77eec65
CAW
32# gettext
33translations = gettext.find(
34 'mediagoblin',
35 pkg_resources.resource_filename(
36 'mediagoblin', 'translations'), ['en'])
37
218b8124
CAW
38# app and global config objects
39app_config = None
40global_config = None
41
42# The actual app object
43app = None
44
df9809c2
CAW
45
46def setup_globals(**kwargs):
68bf5b19
CAW
47 """
48 Sets up a bunch of globals in this module.
49
50 Takes the globals to setup as keyword arguments. If globals are
51 specified that aren't set as variables above, then throw an error.
52 """
6e7ce8d1 53 from mediagoblin import mg_globals
df9809c2
CAW
54
55 for key, value in kwargs.iteritems():
49285baf
E
56 if not hasattr(mg_globals, key):
57 raise AssertionError("Global %s not known" % key)
df9809c2 58 setattr(mg_globals, key, value)