grid_tags.py 文件源码

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

项目:steemprojects.com 作者: noisy 项目源码 文件源码
def style_attribute(attribute_name, package):
    mappings = {
            'title': style_title,
            'repo_description': style_repo_description,
            'commits_over_52': style_commits,
    }

    as_var = template.Variable('package.' + attribute_name)
    try:
        value = as_var.resolve({'package': package})
    except template.VariableDoesNotExist:
        value = ''

    if attribute_name in list(mappings.keys()):
        return  mappings[attribute_name](value)

    return style_default(value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号