This commit is contained in:
hubobel 2025-12-27 12:08:22 +01:00
parent 648e482ffa
commit e701a90645
3 changed files with 22 additions and 14 deletions

View file

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.13" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.9" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

2
.idea/misc.xml generated
View file

@ -3,5 +3,5 @@
<component name="Black">
<option name="sdkName" value="Python 3.13" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
</project>

View file

@ -1,4 +1,4 @@
#V0.1b @PC
#V0.1b @MAC
import requests
import json
from pathlib import Path
@ -260,7 +260,8 @@ def replaceFiles():
e.write(inhalt_neu)
return files
def Simbriefimport():
USERNAME = "hubobel"
#USERNAME = "hubobel"
USERNAME = passw['Prompt']['Simbrief']
URL = "https://www.simbrief.com/api/xml.fetcher.php"
params = {
"username": USERNAME,
@ -271,11 +272,14 @@ def Simbriefimport():
data = resp.json()
general = data.get("general", {})
origin = data.get("origin", {})
origin_name = start_name(origin["icao_code"])
origin_icao = origin["icao_code"]
dest = data.get("destination", {})
dest_name = start_name(dest["icao_code"])
dest_icao = dest["icao_code"]
creationdate = unix_to_datetime(int(data['params']['time_generated']))
aircraft = data.get("aircraft", {})
time = data.get("times", {})
block = minuten_zu_zeit(int(time.get("sched_block")) / 60)
@ -297,11 +301,11 @@ def Simbriefimport():
zfw = data['weights']['est_zfw']
airline_icao = general.get("icao_airline")
route = data['general']['route']
print(data.keys())
print(data['general'])
#print(data.keys())
#print(data['general'])
return (zfw, tow, payload, pax, metar_dest, metar_origin, fuel, distance, fl, flightlevel, flightnumber, airline,
aircraft_name, aircraft_icao, land_time, start_time, block, time, aircraft, dest_icao, dest_name, dest,
origin_icao, origin_name, origin, general, airline_icao, route)
origin_icao, origin_name, origin, general, airline_icao, route, creationdate)
def txtSave(Datei, Inhalt):
voice = None
Inhalt = Inhalt.replace("", "").replace("", "").replace('"', "")
@ -382,16 +386,20 @@ Stimmung = str(stimmung())
(zfw, tow, payload, pax, metar_dest, metar_origin, fuel, distance, fl, flightlevel, flightnumber, airline,
aircraft_name, aircraft_icao, land_time, start_time, block, time, aircraft, dest_icao, dest_name, dest, origin_icao,
origin_name, origin, general, airline_icao, route) = Simbriefimport()
origin_name, origin, general, airline_icao, route, creationdate) = Simbriefimport()
logging.info("--------------------------------------------------")
logging.info("SimbriefUsername: %s",passw['Prompt']['PurserName'])
logging.info("Simbriefdate: %s",passw['Prompt']['CptName'])
logging.info("Simbrief Route: %s", Stimmung)
logging.info("SimbriefUsername: %s",passw['Prompt']['Simbrief'])
logging.info("Simbriefdate: %s",creationdate)
logging.info(
"Simbrief Route: %s / %s",
origin.get("icao_code"),
dest.get("icao_code")
)
logging.info("--------------------------------------------------")
logging.info("--------------------------------------------------")
logging.info("PurserName: %s",passw['Prompt']['PurserName'])
logging.info("Cpt.Name: %s",passw['Prompt']['CptName'])
logging.info("Stimmung: %s", Stimmung)
logging.info("Stimmung: %s",Stimmung)
logging.info("--------------------------------------------------")
logging.info("FLUGINFORMATIONEN")
logging.info("--------------------------------------------------")