• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ disable_python_threads函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中disable_python_threads函数的典型用法代码示例。如果您正苦于以下问题:C++ disable_python_threads函数的具体用法?C++ disable_python_threads怎么用?C++ disable_python_threads使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了disable_python_threads函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: python_api_log_error

static PyObject *
python_api_log_error(PyObject *self, PyObject *args)
{
    PyObject *message = NULL;
    if (!PyArg_ParseTuple(args, "O", &message)) {
        Py_RETURN_NONE;
    }

    char *message_str = python_str_or_unicode_to_string(message);

    allow_python_threads();
    api_log_error(message_str);
    free(message_str);
    disable_python_threads();

    Py_RETURN_NONE;
}
开发者ID:anossov,项目名称:profanity,代码行数:17,代码来源:python_api.c


示例2: python_api_cons_bad_cmd_usage

static PyObject*
python_api_cons_bad_cmd_usage(PyObject *self, PyObject *args)
{
    PyObject *cmd = NULL;
    if (!PyArg_ParseTuple(args, "O", &cmd)) {
        Py_RETURN_NONE;
    }

    char *cmd_str = python_str_or_unicode_to_string(cmd);

    allow_python_threads();
    api_cons_bad_cmd_usage(cmd_str);
    free(cmd_str);
    disable_python_threads();

    Py_RETURN_NONE;
}
开发者ID:anossov,项目名称:profanity,代码行数:17,代码来源:python_api.c


示例3: python_api_send_line

static PyObject*
python_api_send_line(PyObject *self, PyObject *args)
{
    PyObject *line = NULL;
    if (!PyArg_ParseTuple(args, "O", &line)) {
        Py_RETURN_NONE;
    }

    char *line_str = python_str_or_unicode_to_string(line);

    allow_python_threads();
    api_send_line(line_str);
    free(line_str);
    disable_python_threads();

    Py_RETURN_NONE;
}
开发者ID:anossov,项目名称:profanity,代码行数:17,代码来源:python_api.c


示例4: python_api_encryption_reset

static PyObject*
python_api_encryption_reset(PyObject *self, PyObject *args)
{
    PyObject *barejid = NULL;
    if (!PyArg_ParseTuple(args, "O", &barejid)) {
        Py_RETURN_NONE;
    }

    char *barejid_str = python_str_or_unicode_to_string(barejid);

    allow_python_threads();
    api_encryption_reset(barejid_str);
    free(barejid_str);
    disable_python_threads();

    Py_RETURN_NONE;
}
开发者ID:anossov,项目名称:profanity,代码行数:17,代码来源:python_api.c


示例5: python_on_shutdown_hook

void
python_on_shutdown_hook(ProfPlugin *plugin)
{
    disable_python_threads();
    PyObject *p_function;

    PyObject *p_module = plugin->module;
    if (PyObject_HasAttrString(p_module, "prof_on_shutdown")) {
        p_function = PyObject_GetAttrString(p_module, "prof_on_shutdown");
        python_check_error();
        if (p_function && PyCallable_Check(p_function)) {
            PyObject_CallObject(p_function, NULL);
            python_check_error();
            Py_XDECREF(p_function);
        }
    }
    allow_python_threads();
}
开发者ID:cristy-the-one,项目名称:profanity,代码行数:18,代码来源:python_plugins.c


示例6: python_on_disconnect_hook

void
python_on_disconnect_hook(ProfPlugin *plugin, const char *const account_name, const char *const fulljid)
{
    disable_python_threads();
    PyObject *p_args = Py_BuildValue("ss", account_name, fulljid);
    PyObject *p_function;

    PyObject *p_module = plugin->module;
    if (PyObject_HasAttrString(p_module, "prof_on_disconnect")) {
        p_function = PyObject_GetAttrString(p_module, "prof_on_disconnect");
        python_check_error();
        if (p_function && PyCallable_Check(p_function)) {
            PyObject_CallObject(p_function, p_args);
            python_check_error();
            Py_XDECREF(p_function);
        }
    }
    allow_python_threads();
}
开发者ID:cristy-the-one,项目名称:profanity,代码行数:19,代码来源:python_plugins.c


示例7: python_post_room_message_send_hook

void
python_post_room_message_send_hook(ProfPlugin *plugin, const char *const room, const char *message)
{
    disable_python_threads();
    PyObject *p_args = Py_BuildValue("ss", room, message);
    PyObject *p_function;

    PyObject *p_module = plugin->module;
    if (PyObject_HasAttrString(p_module, "prof_post_room_message_send")) {
        p_function = PyObject_GetAttrString(p_module, "prof_post_room_message_send");
        python_check_error();
        if (p_function && PyCallable_Check(p_function)) {
            PyObject_CallObject(p_function, p_args);
            python_check_error();
            Py_XDECREF(p_function);
        }
    }

    allow_python_threads();
}
开发者ID:cristy-the-one,项目名称:profanity,代码行数:20,代码来源:python_plugins.c


示例8: python_post_chat_message_display_hook

void
python_post_chat_message_display_hook(ProfPlugin *plugin, const char *const barejid, const char *const resource, const char *message)
{
    disable_python_threads();
    PyObject *p_args = Py_BuildValue("sss", barejid, resource, message);
    PyObject *p_function;

    PyObject *p_module = plugin->module;
    if (PyObject_HasAttrString(p_module, "prof_post_chat_message_display")) {
        p_function = PyObject_GetAttrString(p_module, "prof_post_chat_message_display");
        python_check_error();
        if (p_function && PyCallable_Check(p_function)) {
            PyObject_CallObject(p_function, p_args);
            python_check_error();
            Py_XDECREF(p_function);
        }
    }
    Py_XDECREF(p_args);
    allow_python_threads();
}
开发者ID:sizeofvoid,项目名称:profanity,代码行数:20,代码来源:python_plugins.c


示例9: python_on_room_win_focus_hook

void
python_on_room_win_focus_hook(ProfPlugin *plugin, const char *const roomjid)
{
    disable_python_threads();
    PyObject *p_args = Py_BuildValue("(s)", roomjid);
    PyObject *p_function;

    PyObject *p_module = plugin->module;
    if (PyObject_HasAttrString(p_module, "prof_on_room_win_focus")) {
        p_function = PyObject_GetAttrString(p_module, "prof_on_room_win_focus");
        python_check_error();
        if (p_function && PyCallable_Check(p_function)) {
            PyObject_CallObject(p_function, p_args);
            python_check_error();
            Py_XDECREF(p_function);
        }
    }

    allow_python_threads();
}
开发者ID:cristy-the-one,项目名称:profanity,代码行数:20,代码来源:python_plugins.c


示例10: python_api_room_unset_message_char

static PyObject*
python_api_room_unset_message_char(PyObject *self, PyObject *args)
{
    PyObject *roomjid = NULL;
    if (!PyArg_ParseTuple(args, "O", &roomjid)) {
        Py_RETURN_NONE;
    }

    char *roomjid_str = python_str_or_unicode_to_string(roomjid);

    allow_python_threads();
    int res = api_room_unset_message_char(roomjid_str);
    free(roomjid_str);
    disable_python_threads();

    if (res) {
        return Py_BuildValue("O", Py_True);
    } else {
        return Py_BuildValue("O", Py_False);
    }
}
开发者ID:anossov,项目名称:profanity,代码行数:21,代码来源:python_api.c


示例11: python_api_chat_unset_titlebar_enctext

static PyObject*
python_api_chat_unset_titlebar_enctext(PyObject *self, PyObject *args)
{
    PyObject *barejid = NULL;
    if (!PyArg_ParseTuple(args, "O", &barejid)) {
        Py_RETURN_NONE;
    }

    char *barejid_str = python_str_or_unicode_to_string(barejid);

    allow_python_threads();
    int res = api_chat_unset_titlebar_enctext(barejid_str);
    free(barejid_str);
    disable_python_threads();

    if (res) {
        return Py_BuildValue("O", Py_True);
    } else {
        return Py_BuildValue("O", Py_False);
    }
}
开发者ID:anossov,项目名称:profanity,代码行数:21,代码来源:python_api.c


示例12: python_on_contact_presence_hook

void
python_on_contact_presence_hook(ProfPlugin *plugin, const char *const barejid, const char *const resource,
    const char *const presence, const char *const status, const int priority)
{
    disable_python_threads();
    PyObject *p_args = Py_BuildValue("ssssi", barejid, resource, presence, status, priority);
    PyObject *p_function;

    PyObject *p_module = plugin->module;
    if (PyObject_HasAttrString(p_module, "prof_on_contact_presence")) {
        p_function = PyObject_GetAttrString(p_module, "prof_on_contact_presence");
        python_check_error();
        if (p_function && PyCallable_Check(p_function)) {
            PyObject_CallObject(p_function, p_args);
            python_check_error();
            Py_XDECREF(p_function);
        }
    }

    allow_python_threads();
}
开发者ID:cristy-the-one,项目名称:profanity,代码行数:21,代码来源:python_plugins.c


示例13: python_on_room_history_message_hook

void
python_on_room_history_message_hook(ProfPlugin *plugin, const char *const room, const char *const nick,
    const char *const message, const char *const timestamp)
{
    disable_python_threads();
    PyObject *p_args = Py_BuildValue("ssss", room, nick, message, timestamp);
    PyObject *p_function;

    PyObject *p_module = plugin->module;
    if (PyObject_HasAttrString(p_module, "prof_on_room_history_message")) {
        p_function = PyObject_GetAttrString(p_module, "prof_on_room_history_message");
        python_check_error();
        if (p_function && PyCallable_Check(p_function)) {
            PyObject_CallObject(p_function, p_args);
            python_check_error();
            Py_XDECREF(p_function);
        }
    }

    allow_python_threads();
}
开发者ID:cristy-the-one,项目名称:profanity,代码行数:21,代码来源:python_plugins.c


示例14: python_on_iq_stanza_receive_hook

gboolean
python_on_iq_stanza_receive_hook(ProfPlugin *plugin, const char *const text)
{
    disable_python_threads();
    PyObject *p_args = Py_BuildValue("(s)", text);
    PyObject *p_function;

    PyObject *p_module = plugin->module;
    if (PyObject_HasAttrString(p_module, "prof_on_iq_stanza_receive")) {
        p_function = PyObject_GetAttrString(p_module, "prof_on_iq_stanza_receive");
        python_check_error();
        if (p_function && PyCallable_Check(p_function)) {
            PyObject *result = PyObject_CallObject(p_function, p_args);
            python_check_error();
            Py_XDECREF(p_function);
            Py_XDECREF(p_args);
            return _handle_boolean_result(plugin, result, "prof_on_iq_stanza_receive");
        }
    }
    Py_XDECREF(p_args);
    allow_python_threads();
    return TRUE;
}
开发者ID:sizeofvoid,项目名称:profanity,代码行数:23,代码来源:python_plugins.c



注:本文中的disable_python_threads函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ disassemble函数代码示例发布时间:2022-05-30
下一篇:
C++ disable_nonboot_cpus函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap