diff options
Diffstat (limited to 'mediagoblin/init')
-rw-r--r-- | mediagoblin/init/__init__.py | 15 | ||||
-rw-r--r-- | mediagoblin/init/celery/__init__.py | 5 | ||||
-rw-r--r-- | mediagoblin/init/celery/from_celery.py | 6 | ||||
-rw-r--r-- | mediagoblin/init/plugins/__init__.py | 4 |
4 files changed, 5 insertions, 25 deletions
diff --git a/mediagoblin/init/__init__.py b/mediagoblin/init/__init__.py index 7c832442..d16027db 100644 --- a/mediagoblin/init/__init__.py +++ b/mediagoblin/init/__init__.py @@ -14,8 +14,6 @@ # 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.tools import staticdirect @@ -146,16 +144,3 @@ 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 8d7a41bd..bb0d5989 100644 --- a/mediagoblin/init/celery/__init__.py +++ b/mediagoblin/init/celery/__init__.py @@ -18,7 +18,7 @@ import os import sys from celery import Celery -from mediagoblin.tools.pluginapi import PluginManager +from mediagoblin.tools.pluginapi import callable_runall MANDATORY_CELERY_IMPORTS = ['mediagoblin.processing.task'] @@ -66,8 +66,7 @@ def setup_celery_app(app_config, global_config, celery_app = Celery() celery_app.config_from_object(celery_settings) - for callable_hook in PluginManager().get_hook_callables('celery_setup'): - callable_hook(celery_app) + callable_runall('celery_setup', celery_app) def setup_celery_from_config(app_config, global_config, diff --git a/mediagoblin/init/celery/from_celery.py b/mediagoblin/init/celery/from_celery.py index 8a794abb..e2899c0b 100644 --- a/mediagoblin/init/celery/from_celery.py +++ b/mediagoblin/init/celery/from_celery.py @@ -22,7 +22,7 @@ from celery.signals import setup_logging from mediagoblin import app, mg_globals from mediagoblin.init.celery import setup_celery_from_config -from mediagoblin.tools.pluginapi import PluginManager +from mediagoblin.tools.pluginapi import callable_runall OUR_MODULENAME = __name__ @@ -47,9 +47,7 @@ def setup_logging_from_paste_ini(loglevel, **kw): logging.config.fileConfig(logging_conf_file) - for callable_hook in \ - PluginManager().get_hook_callables('celery_logging_setup'): - callable_hook() + callable_runall('celery_logging_setup') setup_logging.connect(setup_logging_from_paste_ini) diff --git a/mediagoblin/init/plugins/__init__.py b/mediagoblin/init/plugins/__init__.py index cdf9b5ad..72bd5c7d 100644 --- a/mediagoblin/init/plugins/__init__.py +++ b/mediagoblin/init/plugins/__init__.py @@ -59,6 +59,4 @@ def setup_plugins(): pman.register_hooks(plugin.hooks) # Execute anything registered to the setup hook. - setup_list = pman.get_hook_callables('setup') - for fun in setup_list: - fun() + pluginapi.callable_runall('setup') |