def convert(cf):
rc = []
for i in cf.keys():
if cf[i]['type'] == types.StringType:
rc.append([i, cf[i]['val'], None])
elif cf[i]['type'] == types.FloatType:
rc.append([i, `cf[i]['val']`, None])
elif cf[i]['type'] == types.IntType:
rc.append([i, `cf[i]['val']`, None])
elif cf[i]['type'] == 'toggle':
rc.append([i, write_yes(cf[i]['val']), 'toggle'])
elif cf[i]['type'] == types.ListType:
rc.append([i, `cf[i]['val']`, None])
else:
error("don't know how to handle " + `cf[i]['type']`)
return rc
评论列表
文章目录