-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaircraft.py
46 lines (39 loc) · 1.32 KB
/
aircraft.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
41
42
43
44
45
46
# -*- coding: utf-8 -*-
import requests
import json
from bs4 import BeautifulSoup
from geoloc import Coordinates
# Decoders for countries here
class Aircraft:
def __init__(self, tail_n, msn=None, call=None, \
latitude=None, longitude=None, craft_type=None, \
origin=None, destination=None, altitude=None, \
manufacturer=None, icao=None,notes=None):
self.tail_n = tail_n
self.msn = msn
self.call = call
self.origin = origin
self.manufacturer = manufacturer
self.destination = destination
self.altitude = altitude
self.latitude = latitude
self.longitude = longitude
self.icao = icao
self.notes = notes
def __str__(self):
return self.__repr__()
def __repr__(self):
return """
Manufacturer/Type: %s
Manufacturer Serial Number: %s
Transponder code (ICAO24): %s
Tail Number: %s
Call Sign: %s
Last known position: %s
Last known altitude: %s
Notes:
%s
""" % (self.manufacturer, self.msn,
self.icao, self.tail_n,
self.call, (self.latitude, self.longitude),
self.altitude, self.notes)