fixed some typos and enabled media_type plugins in tests
authorRodney Ewing <ewing.rj@gmail.com>
Tue, 2 Jul 2013 14:54:38 +0000 (07:54 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Tue, 2 Jul 2013 15:06:39 +0000 (08:06 -0700)
mediagoblin.ini
mediagoblin/db/mixin.py
mediagoblin/media_types/image/__init__.py
mediagoblin/tests/test_mgoblin_app.ini

index 951e0d8a3a04434b47f0c26ed99b2d554e66cfef..035e7bcfdac66448ce2b5f395c7f537deb024905 100644 (file)
@@ -43,3 +43,4 @@ base_url = /mgoblin_media/
 [plugins]
 [[mediagoblin.plugins.geolocation]]
 [[mediagoblin.plugins.basic_auth]]
+[[mediagoblin.media_types.image]]
index 2d878c80d7cadcf5470ae6bcd6bc9a348569066c..26e41a3b24fd259578f1d74fa8c9ce538b895e03 100644 (file)
@@ -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):
         """
index 6303bbe0d181e45d0a68dde0c5f5c2b9f026384f..4b991588c5897da11fb9dbf913080c34f4d27cfb 100644 (file)
@@ -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,
 }
index 5b060d36dedb9ca7e858ac3a3c2df0d84272b3f9..ecd6c9d2c830f8d23484cfe5c4db2961db1fe14c 100644 (file)
@@ -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]]