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"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <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" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

2
.idea/misc.xml generated
View file

@ -3,5 +3,5 @@
<component name="Black"> <component name="Black">
<option name="sdkName" value="Python 3.13" /> <option name="sdkName" value="Python 3.13" />
</component> </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> </project>

View file

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