forked from DavidSweetman/FlightRouteCalculator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Airport.py
40 lines (22 loc) · 769 Bytes
/
Airport.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
__author__ = 'David'
from CountryAtlas import *
import Country
class Airport:
countryAtlas = CountryAtlas()
def __init__(self, airportName, cityName, country, code, latitude, longitude):
self.airportName = airportName
self.cityName = cityName
self.country = self.countryAtlas.getCountry(country.upper())
self.code = code.upper()
self.latitude = float(latitude)
self.longitude = float(longitude)
def __str__(self):
return self.code
def __repr__(self):
return str(self)
def main():
myAirport = Airport("Dublin", "Dublin", "IRELAND", "DUB", "53", "-6")
print(myAirport.country.rateTo())
print(myAirport.country.rateFrom())
if __name__ == "__main__":
main()