core.py 文件源码

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

项目:marvin 作者: bassdread 项目源码 文件源码
def do(self, function_name, data):
        if function_name in dir(self.module):
            if self.debug is True:
                # this makes the plugin fail with stack trace in debug mode
                eval("self.module." + function_name)(data)
            else:
                # otherwise we log the exception and carry on
                try:
                    eval("self.module." + function_name)(data)
                except Exception:
                    logging.exception("problem in module {} {}".format(function_name, data))
        if "catch_all" in dir(self.module):
            if self.debug is True:
                # this makes the plugin fail with stack trace in debug mode
                self.module.catch_all(data)
            else:
                try:
                    self.module.catch_all(data)
                except Exception:
                    logging.exception("problem in catch all: {} {}".format(self.module, data))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号