tasks.py 文件源码

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

项目:Snakepit 作者: K4lium 项目源码 文件源码
def saveScore(analysis_id, score):
    """Save calculated score back to pit."""
    a = ANALYSIS_TEMPLATE.copy()
    a['id'] = analysis_id
    a['score'] = score

    resp = requests.patch('/'.join([pit_url, 'analysis', str(analysis_id)]),
                          data=json.dumps(a), headers=post_headers)
    resp.raise_for_status()


# For an analysis item:
# * Fetch the item.
# * Fetch all relevant rules.
# * Evaluate each rule, keeping a running total of score.
# * Save score to analysis item.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号