__init__.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:hangoutsbot 作者: das7pad 项目源码 文件源码
def reload_plugin(bot, module_path):
    """reload a plugin and keep track of multiple reloads

    Note: the plugin may reset the sentinal on a successfull internal load

    Args:
        module_path: string, plugin path on disk relative to the main script

    Returns:
        boolean, False if the plugin may not be reloaded again, otherwise True
    """
    repeat = SENTINALS.setdefault(module_path, 0)
    if repeat >= 3:
        logger.critical('too many reloads of %s, enter failstate', module_path)
        return False
    SENTINALS[module_path] += 1
    await unload(bot, module_path)
    await load(bot, module_path)
    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号