ident.py 文件源码

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

项目:deb-python-pysaml2 作者: openstack 项目源码 文件源码
def code(item):
    """
    Turn a NameID class instance into a quoted string of comma separated
    attribute,value pairs. The attribute names are replaced with digits.
    Depends on knowledge on the specific order of the attributes for the
    class that is used.

    :param item: The class instance
    :return: A quoted string
    """
    _res = []
    i = 0
    for attr in ATTR:
        val = getattr(item, attr)
        if val:
            _res.append("%d=%s" % (i, quote(val)))
        i += 1
    return ",".join(_res)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号