aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/init
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/init')
-rw-r--r--mediagoblin/init/__init__.py18
-rw-r--r--mediagoblin/init/celery/__init__.py2
-rw-r--r--mediagoblin/init/celery/from_celery.py2
-rw-r--r--mediagoblin/init/celery/from_tests.py2
-rw-r--r--mediagoblin/init/config.py2
5 files changed, 21 insertions, 5 deletions
diff --git a/mediagoblin/init/__init__.py b/mediagoblin/init/__init__.py
index 44f604b1..b7f52595 100644
--- a/mediagoblin/init/__init__.py
+++ b/mediagoblin/init/__init__.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 Free Software Foundation, Inc
+# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -14,7 +14,10 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from beaker.cache import CacheManager
+from beaker.util import parse_cache_config_options
import jinja2
+
from mediagoblin import staticdirect
from mediagoblin.init.config import (
read_mediagoblin_config, generate_validation_report)
@@ -135,3 +138,16 @@ def setup_workbench():
workbench_manager = WorkbenchManager(app_config['workbench_path'])
setup_globals(workbench_manager = workbench_manager)
+
+
+def setup_beaker_cache():
+ """
+ Setup the Beaker Cache manager.
+ """
+ cache_config = mg_globals.global_config['beaker.cache']
+ cache_config = dict(
+ [(u'cache.%s' % key, value)
+ for key, value in cache_config.iteritems()])
+ cache = CacheManager(**parse_cache_config_options(cache_config))
+ setup_globals(cache=cache)
+ return cache
diff --git a/mediagoblin/init/celery/__init__.py b/mediagoblin/init/celery/__init__.py
index bfae954e..c58b1305 100644
--- a/mediagoblin/init/celery/__init__.py
+++ b/mediagoblin/init/celery/__init__.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 Free Software Foundation, Inc
+# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/init/celery/from_celery.py b/mediagoblin/init/celery/from_celery.py
index c053591b..3e5adb98 100644
--- a/mediagoblin/init/celery/from_celery.py
+++ b/mediagoblin/init/celery/from_celery.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 Free Software Foundation, Inc
+# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/init/celery/from_tests.py b/mediagoblin/init/celery/from_tests.py
index b2293e2c..059d829f 100644
--- a/mediagoblin/init/celery/from_tests.py
+++ b/mediagoblin/init/celery/from_tests.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 Free Software Foundation, Inc
+# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/init/config.py b/mediagoblin/init/config.py
index 2f93d32c..029a0956 100644
--- a/mediagoblin/init/config.py
+++ b/mediagoblin/init/config.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 Free Software Foundation, Inc
+# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by