update_tags.py 文件源码

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

项目:nova 作者: hubblestack 项目源码 文件源码
def _get_cis(xls_filename, sheet_index=1):
    '''Return dictionary of cis title's and their corresponding cis tag'''
    tag_col = 1
    title_col = 2
    score_col = 4

    workbook = xlrd.open_workbook(xls_filename)
    worksheet = workbook.sheet_by_index(sheet_index)

    ret = {}

    for row_num in range(1,worksheet.nrows):
        scoring_status = worksheet.cell(row_num, score_col).value
        if scoring_status != 'scored':
            continue

        title = str(worksheet.cell(row_num, title_col).value).lower()
        rec_num = worksheet.cell(row_num, tag_col).value
        if isinstance(rec_num, float):
            rec_num = str(rec_num) + '0'
        rec_num = 'CIS-' + str(rec_num)
        ret[title] = rec_num
    return ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号