INNER CODE UNIT · Python
retrieve_value
ANG13T/skytrack · modules/airport_info.py:39
def retrieve_value(line, val):
if val <= len(line) - 1:
return line[val]
return None
def get_airport_info(airport_ident, airport_name):
headers = {
'User-Agent': 'SKYTRACK: Aviation-based intelligence gathering tool'\
'Information at: https://github.com/ANG13T/skytrack'
}
if not os.path.exists(cache_path) or os.stat(cache_path).st_size == 0:
r = requests.get(
URL,
stream=True,
headers=headers)
if r.status_code == 200: