From a0b3f737d765a98956ce5ec308ef99e3cf33a648 Mon Sep 17 00:00:00 2001 From: NomsterDude <85312283+NomsterDude@users.noreply.github.com> Date: Fri, 10 Jun 2022 19:02:04 -0700 Subject: [PATCH 1/2] Update __main__.py Updated print statements to f-strings. --- __main__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/__main__.py b/__main__.py index 4ac9890..d2dcedf 100644 --- a/__main__.py +++ b/__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 \ No newline at end of file + raise e From ee726f9c6bdad07b07846586de61fb01620f0ad3 Mon Sep 17 00:00:00 2001 From: NomsterDude <85312283+NomsterDude@users.noreply.github.com> Date: Fri, 10 Jun 2022 19:50:04 -0700 Subject: [PATCH 2/2] Update __main__.py --- __main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__main__.py b/__main__.py index d2dcedf..ed14422 100644 --- a/__main__.py +++ b/__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(f'{file_name} does not exist downloading now") + print(f"{file_name} does not exist downloading now") try: import requests file_content = requests.get(url)