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