def __decode(queryResults, passengerType): for queryResult in queryResults: info = queryResult.split('|') ticket = TicketDetails() ticket.passengerType = passengerType ticket.trainNo = info[INDEX_TRAIN_NO] ticket.startStationCode = info[INDEX_TRAIN_START_STATION_CODE] ticket.endStationCode = info[INDEX_TRAIN_END_STATION_CODE] ticket.fromStationCode = info[INDEX_TRAIN_FROM_STATION_CODE] ticket.toStationCode = info[INDEX_TRAIN_TO_STATION_CODE] ticket.leaveTime = info[INDEX_TRAIN_LEAVE_TIME] ticket.arriveTime = info[INDEX_TRAIN_ARRIVE_TIME] ticket.totalConsume = info[INDEX_TRAIN_TOTAL_CONSUME] ticket.businessSeat = info[INDEX_TRAIN_BUSINESS_SEAT] ticket.firstClassSeat = info[INDEX_TRAIN_FIRST_CLASS_SEAT] ticket.secondClassSeat = info[INDEX_TRAIN_SECOND_CLASS_SEAT] ticket.advancedSoftSleep = info[INDEX_TRAIN_ADVANCED_SOFT_SLEEP] ticket.softSleep = info[INDEX_TRAIN_SOFT_SLEEP] ticket.moveSleep = info[INDEX_TRAIN_MOVE_SLEEP] ticket.hardSleep = info[INDEX_TRAIN_HARD_SLEEP] ticket.softSeat = info[INDEX_TRAIN_SOFT_SEAT] ticket.hardSeat = info[INDEX_TRAIN_HARD_SEAT] ticket.noSeat = info[INDEX_TRAIN_NO_SEAT] ticket.other = info[INDEX_TRAIN_OTHER] ticket.mark = info[INDEX_TRAIN_MARK] ticket.startStation = code2city(ticket.startStationCode) ticket.endStation = code2city(ticket.endStationCode) ticket.fromStation = code2city(ticket.fromStationCode) ticket.toStation = code2city(ticket.toStationCode) ticket.secretStr = info[INDEX_SECRET_STR] ticket.startDate = info[INDEX_START_DATE] yield ticket
def __decode(queryResults, passengerType): for queryResult in queryResults: info = queryResult.split('|') ticket = TicketDetails() ticket.passengerType = passengerType ticket.trainNo = info[3] ticket.startStationCode = info[4] ticket.endStationCode = info[5] ticket.fromStationCode = info[6] ticket.toStationCode = info[7] ticket.leaveTime = info[8] ticket.arriveTime = info[9] ticket.totalConsume = info[10] ticket.businessSeat = info[32] ticket.firstClassSeat = info[31] ticket.secondClassSeat = info[30] ticket.advancedSoftSleep = info[21] ticket.softSleep = info[23] ticket.moveSleep = info[33] ticket.hardSleep = info[28] ticket.softSeat = info[24] ticket.hardSeat = info[29] ticket.noSeat = info[28] ticket.other = info[22] ticket.mark = info[1] ticket.startStation = code2city(ticket.startStationCode) ticket.endStation = code2city(ticket.endStationCode) ticket.fromStation = code2city(ticket.fromStationCode) ticket.toStation = code2city(ticket.toStationCode) ticket.secretStr = info[0] ticket.startDate = info[13] yield ticket