Run a specific plugin

def run(plugin_name, *args, **kwargs):
    """ Run a specific plugin """
    plugindir = nago.settings.get_option('plugin_dir')
    plugin = plugindir + "/" + plugin_name
    if not os.path.isfile(plugin):
        raise ValueError("Plugin %s not found" % plugin)

    command = [plugin] + list(args)
    p = subprocess.Popen(command, stdout=subprocess.PIPE,stderr=subprocess.PIPE,)
    stdout, stderr = p.communicate('through stdin to stdout')
    result = {}
    result['stdout'] = stdout
    result['stderr'] = stderr
    result['return_code'] = p.returncode
    return result