def from_func(plugin_baseclass=None):

    if plugin_baseclass:
        if not issubclass(plugin_baseclass, Plugin):
            raise TypeError("plugin_baseclass should be subclass of %s "
                            % Plugin)

        class FuncPlugin(plugin_baseclass):
            pass

    else:
        class FuncPlugin(Plugin):
            pass

    def decorator(func):
        func._plugin = FuncPlugin

        # NOTE(boris-42): This is required by Plugin.get_all method to
        #                 return func instead of FuncPlugin that will be
        #                 auto discovered.
        FuncPlugin.func_ref = func

        # NOTE(boris-42): Make aliases from func to all public Plugin fields
        for field in dir(func._plugin):
            if not field.startswith("__"):
                obj = getattr(func._plugin, field)
                if callable(obj):
                    setattr(func, field, obj)

        return func

    return decorator
Produce html documentation for a property.
dataset/ETHPy150Open openstack/rally/rally/common/plugin/plugin.py/from_func--crossover with--dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/pydoc.py/HTMLDoc.docproperty