diff options
author | Aditi <aditi.iitr@gmail.com> | 2013-07-16 06:48:33 +0530 |
---|---|---|
committer | Aditi <aditi.iitr@gmail.com> | 2013-07-16 06:48:33 +0530 |
commit | 67d303ffa96a80da3a3cf48d2f9231bc1a087a19 (patch) | |
tree | 8bd1af9ec13fed7c340a6329632bddf2d17e3fb6 /docs/source/pluginwriter | |
parent | 7b77f7e490a27de57a4dab5301662ef95d11b213 (diff) | |
parent | 64ad0beea83b1f4b50462bcb67c54156fc9365a5 (diff) | |
download | mediagoblin-67d303ffa96a80da3a3cf48d2f9231bc1a087a19.tar.lz mediagoblin-67d303ffa96a80da3a3cf48d2f9231bc1a087a19.tar.xz mediagoblin-67d303ffa96a80da3a3cf48d2f9231bc1a087a19.zip |
merge with remote master branch of cweb.
Diffstat (limited to 'docs/source/pluginwriter')
-rw-r--r-- | docs/source/pluginwriter/media_type_hooks.rst | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/docs/source/pluginwriter/media_type_hooks.rst b/docs/source/pluginwriter/media_type_hooks.rst new file mode 100644 index 00000000..498b0b54 --- /dev/null +++ b/docs/source/pluginwriter/media_type_hooks.rst @@ -0,0 +1,38 @@ +================== + Media Type hooks +================== + +This documents the hooks that are currently available for ``media_type`` plugins. + +What hooks are available? +========================= + +'sniff_handler' +--------------- + +This hook is used by ``sniff_media`` in ``mediagoblin.media_types.__init__``. +Your media type should return its ``sniff_media`` method when this hook is +called. + +.. Note:: + Your ``sniff_media`` method should return either the ``media_type`` or + ``None``. + +'get_media_type_and_manager' +---------------------------- + +This hook is used by ``get_media_type_and_manager`` in +``mediagoblin.media_types.__init__``. When this hook is called, your media type +plugin should check if it can handle the given extension. If so, your media +type plugin should return the media type and media manager. + +('media_manager', MEDIA_TYPE) +----------------------------- + +If you already know the string representing the media type of a type +of media, you can pull down the manager specifically. Note that this +hook is not a string but a tuple of two strings, the latter being the +name of the media type. + +This is used by media entries to pull down their media managers, and +so on. |