def minPointsFlight(): minPoints = 5000 flights = getAllFlights() for flight in flights: fares = getFaresForFlight(flight) for fare in fares: if (fare.points < minPoints): minPoints = fare.points print(minPoints)
def checkForRefunds(): flights = getAllFlights() #flights = getUserFlights('scottblackburn') for flight in flights: fares = getFaresForFlight(flight) flight.addFares(fares) refund = flight.checkRefund() print(flight) if refund: if refund > (flight.maxDrop + 1): #+1 for rounding error refundStr = "Refund Found! Re-book on southwest.com for a refund of %s\n%s\nYou will receive another email if the price drops lower" % (diffCostString(refund, flight.usingPoints), str(flight)) sendEmail(getUser(flight.username).email, 'Southwest Refund Found: ' + flight.basicStr(), refundStr) flight.maxDrop = refund putUserFlight(flight) else: print(str(flight) + '-- Refund found, but not a large enough drop')
def checkForRefunds(): flights = getAllFlights() #flights = getUserFlights('scottblackburn') for flight in flights: fares = getFaresForFlight(flight) flight.addFares(fares) refund = flight.checkRefund() print(flight) if refund: if refund > (flight.maxDrop + 1): #+1 for rounding error refundStr = "Refund Found! Re-book on southwest.com for a refund of %s\n%s\nYou will receive another email if the price drops lower" % ( diffCostString(refund, flight.usingPoints), str(flight)) sendEmail( getUser(flight.username).email, 'Southwest Refund Found: ' + flight.basicStr(), refundStr) flight.maxDrop = refund putUserFlight(flight) else: print( str(flight) + '-- Refund found, but not a large enough drop')
def printFlightsWithoutFares(): flights = getAllFlights() for flight in flights: fares = getFaresForFlight(flight) if (len(fares) == 0): print(flight)