config_policy.py 文件源码

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

项目:snap-plugin-lib-py 作者: intelsdi-x 项目源码 文件源码
def _check_key(key):
    errors = []
    if isinstance(key, tuple):
        for i in key:
            if not isinstance(i, basestring):
                errors.append("Expected: string, Received: {}:{}"
                              .format(type(i), i))
    elif isinstance(key, basestring):
        return (key,), key
    elif key is None:
        return "", ""
    else:
        raise TypeError("Expected: tuple of strings, Received: {}"
                        .format(type(key)))
    if len(errors) > 0:
        raise TypeError(errors)
    return key, ".".join(key)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号