commands.py 文件源码

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

项目:knack 作者: Microsoft 项目源码 文件源码
def _get_op_handler(operation):
        """ Import and load the operation handler """
        try:
            mod_to_import, attr_path = operation.split('#')
            op = import_module(mod_to_import)
            for part in attr_path.split('.'):
                op = getattr(op, part)
            if isinstance(op, types.FunctionType):
                return op
            return six.get_method_function(op)
        except (ValueError, AttributeError):
            raise ValueError("The operation '{}' is invalid.".format(operation))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号