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
评论列表
文章目录