From: Rodney Ewing Date: Tue, 2 Jul 2013 14:54:38 +0000 (-0700) Subject: fixed some typos and enabled media_type plugins in tests X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e699197258d5e1b5495e60cb2c238b3ff4f50ed4;p=mediagoblin.git fixed some typos and enabled media_type plugins in tests --- diff --git a/mediagoblin.ini b/mediagoblin.ini index 951e0d8a..035e7bcf 100644 --- a/mediagoblin.ini +++ b/mediagoblin.ini @@ -43,3 +43,4 @@ base_url = /mgoblin_media/ [plugins] [[mediagoblin.plugins.geolocation]] [[mediagoblin.plugins.basic_auth]] +[[mediagoblin.media_types.image]] diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py index 2d878c80..26e41a3b 100644 --- a/mediagoblin/db/mixin.py +++ b/mediagoblin/db/mixin.py @@ -208,7 +208,8 @@ class MediaEntryMixin(GenerateSlugMixin): return manager # Not found? Then raise an error raise FileTypeNotSupported( - "MediaManager not in enabled types. Check media_types in config?") + "MediaManager not in enabled types. Check media_type plugins are" + " enabled in config?") def get_fail_exception(self): """ diff --git a/mediagoblin/media_types/image/__init__.py b/mediagoblin/media_types/image/__init__.py index 6303bbe0..4b991588 100644 --- a/mediagoblin/media_types/image/__init__.py +++ b/mediagoblin/media_types/image/__init__.py @@ -26,7 +26,7 @@ MEDIA_TYPE = 'mediagoblin.media_types.image' def setup_plugin(): - config = pluginapi.get_config('mediagoblin.pluginapi.media_types.image') + config = pluginapi.get_config('mediagoblin.media_types.image') class ImageMediaManager(MediaManagerBase): @@ -66,12 +66,12 @@ def get_media_manager(media_type): def get_media_type_and_manager(ext): if ext in ACCEPTED_EXTENSIONS: - return ImageMediaManager + return MEDIA_TYPE, ImageMediaManager hooks = { 'setup': setup_plugin, - 'extensions': get_media_type_and_manager, + 'get_media_type_and_manager': get_media_type_and_manager, 'sniff_handler': sniff_handler, 'get_media_manager': get_media_manager, } diff --git a/mediagoblin/tests/test_mgoblin_app.ini b/mediagoblin/tests/test_mgoblin_app.ini index 5b060d36..ecd6c9d2 100644 --- a/mediagoblin/tests/test_mgoblin_app.ini +++ b/mediagoblin/tests/test_mgoblin_app.ini @@ -12,8 +12,6 @@ tags_max_length = 50 # So we can start to test attachments: allow_attachments = True -media_types = mediagoblin.media_types.image, mediagoblin.media_types.pdf - [storage:publicstore] base_dir = %(here)s/user_dev/media/public base_url = /mgoblin_media/ @@ -32,3 +30,5 @@ BROKER_HOST = "sqlite:///%(here)s/user_dev/kombu.db" [[mediagoblin.plugins.httpapiauth]] [[mediagoblin.plugins.piwigo]] [[mediagoblin.plugins.basic_auth]] +[[mediagoblin.media_types.image]] +[[mediagoblin.media_types.pdf]]