report_parser.py 文件源码

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

项目:fdra 作者: grizzlybears 项目源码 文件源码
def parse_1_pos_row( cells_in_row, rowno ):

    col_count = len(cells_in_row)
    if ( col_count < 9 ):
        print "?%d???%d???????'????'? " % ( rowno, col_count)
        return None

    one_entry =  PositionAggreRecord()

    #??
    one_entry.contract = cells_in_row[0].value

    #??
    target = get_target_from_contract( one_entry.contract )
    if (target is None):
        print "?%d? ?????‘????’??????'????'? " % ( rowno, )
        return None

    one_entry.target = target

    #?/?
    buy_vol_cell = cells_in_row[1]
    if ( buy_vol_cell.ctype == xlrd.XL_CELL_NUMBER  ):
        one_entry.b_or_s = '?'
        one_entry.volume = int(buy_vol_cell.value)
        one_entry.avg_price = float(cells_in_row[2].value)
    else:
        one_entry.b_or_s = '?'
        one_entry.volume = int(cells_in_row[3].value)
        one_entry.avg_price = float(cells_in_row[4].value)

    #??
    one_entry.prev_settle_price = float(cells_in_row[5].value)
    #??
    one_entry.today_settle_price = float(cells_in_row[6].value)

    #??
    one_entry.profit = float (cells_in_row[7].value)

    return one_entry

# ??'????' sheet? ???? TradeAggreRecord???
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号