fixed some typos and enabled media_type plugins in tests
This commit is contained in:
parent
2d9a452c3a
commit
e699197258
@ -43,3 +43,4 @@ base_url = /mgoblin_media/
|
|||||||
[plugins]
|
[plugins]
|
||||||
[[mediagoblin.plugins.geolocation]]
|
[[mediagoblin.plugins.geolocation]]
|
||||||
[[mediagoblin.plugins.basic_auth]]
|
[[mediagoblin.plugins.basic_auth]]
|
||||||
|
[[mediagoblin.media_types.image]]
|
||||||
|
@ -208,7 +208,8 @@ class MediaEntryMixin(GenerateSlugMixin):
|
|||||||
return manager
|
return manager
|
||||||
# Not found? Then raise an error
|
# Not found? Then raise an error
|
||||||
raise FileTypeNotSupported(
|
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):
|
def get_fail_exception(self):
|
||||||
"""
|
"""
|
||||||
|
@ -26,7 +26,7 @@ MEDIA_TYPE = 'mediagoblin.media_types.image'
|
|||||||
|
|
||||||
|
|
||||||
def setup_plugin():
|
def setup_plugin():
|
||||||
config = pluginapi.get_config('mediagoblin.pluginapi.media_types.image')
|
config = pluginapi.get_config('mediagoblin.media_types.image')
|
||||||
|
|
||||||
|
|
||||||
class ImageMediaManager(MediaManagerBase):
|
class ImageMediaManager(MediaManagerBase):
|
||||||
@ -66,12 +66,12 @@ def get_media_manager(media_type):
|
|||||||
|
|
||||||
def get_media_type_and_manager(ext):
|
def get_media_type_and_manager(ext):
|
||||||
if ext in ACCEPTED_EXTENSIONS:
|
if ext in ACCEPTED_EXTENSIONS:
|
||||||
return ImageMediaManager
|
return MEDIA_TYPE, ImageMediaManager
|
||||||
|
|
||||||
|
|
||||||
hooks = {
|
hooks = {
|
||||||
'setup': setup_plugin,
|
'setup': setup_plugin,
|
||||||
'extensions': get_media_type_and_manager,
|
'get_media_type_and_manager': get_media_type_and_manager,
|
||||||
'sniff_handler': sniff_handler,
|
'sniff_handler': sniff_handler,
|
||||||
'get_media_manager': get_media_manager,
|
'get_media_manager': get_media_manager,
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,6 @@ tags_max_length = 50
|
|||||||
# So we can start to test attachments:
|
# So we can start to test attachments:
|
||||||
allow_attachments = True
|
allow_attachments = True
|
||||||
|
|
||||||
media_types = mediagoblin.media_types.image, mediagoblin.media_types.pdf
|
|
||||||
|
|
||||||
[storage:publicstore]
|
[storage:publicstore]
|
||||||
base_dir = %(here)s/user_dev/media/public
|
base_dir = %(here)s/user_dev/media/public
|
||||||
base_url = /mgoblin_media/
|
base_url = /mgoblin_media/
|
||||||
@ -32,3 +30,5 @@ BROKER_HOST = "sqlite:///%(here)s/user_dev/kombu.db"
|
|||||||
[[mediagoblin.plugins.httpapiauth]]
|
[[mediagoblin.plugins.httpapiauth]]
|
||||||
[[mediagoblin.plugins.piwigo]]
|
[[mediagoblin.plugins.piwigo]]
|
||||||
[[mediagoblin.plugins.basic_auth]]
|
[[mediagoblin.plugins.basic_auth]]
|
||||||
|
[[mediagoblin.media_types.image]]
|
||||||
|
[[mediagoblin.media_types.pdf]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user