Document _call_plugin.

This commit is contained in:
Stefan van der Walt
2009-11-01 11:59:10 +02:00
parent cdb1a1560f
commit e7d6875cab
+13
View File
@@ -3,6 +3,19 @@ __all__ = ['imread', 'imsave', 'imshow']
from scikits.image.io.plugin import plugin_store
def _call_plugin(kind, *args, **kwargs):
"""Find the appropriate plugin of 'kind' and execute it.
Parameters
----------
kind : {'imshow', 'imsave', 'imread'}
Function to look up.
plugin : str, optional
Plugin to load. Defaults to None, in which case the first
matching plugin is used.
*args, **kwargs : arguments and keyword arguments
Passed to the plugin function.
"""
if not kind in plugin_store:
raise ValueError('Invalid function (%s) requested.' % kind)