Exemplo n.º 1
0
def displayFlights():
	print "Checking for new flights..."
	currentFlights = retrieveflights.retrieveUpdateFlights()
	counter = 1
	for flight in currentFlights:
		print "----------"
		print "Boarding Pass {}".format(counter)
		print "Confirmation Number {}".format(flight.confnum)
		print "Passenger Name: {} {}".format(flight.firstname, flight.lastname)
		print "----------"
		print"Departure Times at Departure Airports:"
		for flightAirport in flight.datesairports:
			print "{} from {}".format(flightAirport[0].strftime("%d %b %Y %H:%M"),
									 flightAirport[1])
		offsetInt, utcoffset = offsetFromUTC()
		print "Departure Times in your local timezone (UTC{}): ".format(offsetInt)
		innerloop = 0
		for flightTime in flight.departuresInLocalTime(utcoffset):
			print "{} from {}".format(flightTime.strftime("%d %b %Y %H:%M"),
									  flight.datesairports[innerloop][1])
			innerloop += 1
		counter += 1
		print "Time remaining to earliest check-in: {}".format(flight.timeBeforeCheckin())
	print "=========="
	print "End boarding pass listings.\n"
	return currentFlights
Exemplo n.º 2
0
def plistCheckinLocalTimes():
	currentFlights = retrieveflights.retrieveUpdateFlights()
	offset, timedeltaOffset = offsetFromUTC()
	checkinTimes = [fl.plistCheckinInLocalTime(timedeltaOffset) for fl in currentFlights]
	checkinTimes = [item for sublist in checkinTimes for item in sublist]
	return checkinTimes