예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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')
예제 #4
0
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')
예제 #5
0
def printFlightsWithoutFares():
	flights = getAllFlights()
	for flight in flights:
		fares = getFaresForFlight(flight)
		if (len(fares) == 0):
			print(flight)
예제 #6
0
def printFlightsWithoutFares():
    flights = getAllFlights()
    for flight in flights:
        fares = getFaresForFlight(flight)
        if (len(fares) == 0):
            print(flight)