Browse Source

Update __main__.py

Updated print statements to f-strings.
pull/55/head
NomsterDude 3 years ago committed by GitHub
parent
commit
a0b3f737d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      __main__.py

16
__main__.py

@ -25,7 +25,7 @@ for file in required_files:
file_name = file[0]
url = file[1]
if not os.path.isfile("./dependencies/" + file_name):
print(file_name, "does not exist downloading now")
print(f'{file_name} does not exist downloading now")
try:
import requests
file_content = requests.get(url)
@ -34,9 +34,9 @@ for file in required_files:
except Exception as e:
raise e("Error getting", file_name, "from", url)
else:
print("Successfully got", file_name)
print(f"Successfully got {file_name}")
else:
print("Already have", file_name, "continuing")
print(f"Already have {file_name} continuing")
if os.path.isfile("./dependencies/" + required_files[4][0]) and not os.path.isfile("./dependencies/aircrafts.json"):
print("Extracting Mictronics DB")
from zipfile import ZipFile
@ -62,7 +62,7 @@ else:
print("Route lookup is disabled")
try:
print("Source is set to", source)
print(f"Source is set to {source}")
import sys
#Setup plane objects from plane configs
planes = {}
@ -83,7 +83,7 @@ try:
except pytz.exceptions.UnknownTimeZoneError:
tz = pytz.UTC
last_ra_count = None
print(len(planes), "Planes configured")
print(f"{len(planes)} Planes configured")
while True:
datetime_tz = datetime.now(tz)
if datetime_tz.hour == 0 and datetime_tz.minute == 0:
@ -91,7 +91,7 @@ try:
running_Count +=1
start_time = time.time()
header = ("-------- " + str(running_Count) + " -------- " + str(datetime_tz.strftime("%I:%M:%S %p")) + " ---------------------------------------------------------------------------")
print (Back.GREEN + Fore.BLACK + header[0:100] + Style.RESET_ALL)
print (f"{Back.GREEN} {Fore.BLACK} {header[0:100]} {Style.RESET_ALL}")
if source == "ADSBX":
#ACAS data
from defADSBX import pull_date_ras
@ -121,7 +121,7 @@ try:
last_ra_count = ra_count
for key, obj in planes.items():
if sorted_ras != {} and key in sorted_ras.keys():
print(key, "has", len(sorted_ras[key]), "RAs")
print(f"{key} has {len(sorted_ras[key])} RAs")
obj.check_new_ras(sorted_ras[key])
obj.expire_ra_types()
#Normal API data
@ -214,4 +214,4 @@ except Exception as e:
logging.error(str(traceback.format_exc()))
from defDiscord import sendDis
sendDis(str("Error Exiting: " + str(e) + " Failed on " + "https://globe.adsbexchange.com/?icao=" + key), main_config, main_config.get('DISCORD', 'ROLE_ID'), "crash_latest.log")
raise e
raise e

Loading…
Cancel
Save