Version eingebaut

This commit is contained in:
hubobel 2025-12-28 17:06:04 +01:00
parent 0b79cc99ad
commit 98d9a84031
2 changed files with 16 additions and 4 deletions

View file

@ -1,4 +1,4 @@
#V0.1.1b @MAC
#V0.1.1b @PC
import requests
import json
from pathlib import Path
@ -10,8 +10,17 @@ import random
import shutil
import logging
from logging.handlers import RotatingFileHandler
from version import VERSION
def get_build():
try:
import subprocess
return subprocess.check_output(
["git", "rev-list", "--count", "HEAD"],
stderr=subprocess.DEVNULL
).decode().strip()
except Exception:
return "0"
def setup_logging(app_dir, level=logging.INFO, console=True):
logging.getLogger("httpx").setLevel(logging.WARNING)
log_file = app_dir / "Simbriefimport.log"
@ -467,7 +476,7 @@ ordnerneu.mkdir(exist_ok=True)
logging.info("--------------------------------------------------")
logging.info("START .txt Erzeugung ")
logging.info("--------------------------------------------------")
debug = False
debug = True
if debug == False:
metarCabin = METAR()
metar = metarCabin.choices[0].message.content
@ -533,4 +542,6 @@ if debug == False:
logging.info("--------------------------------------------------")
logging.info(" F E R T S C H ")
logging.info("--------------------------------------------------")
logging.info("--------------------------------------------------")
logging.info("Version: %s.%s", VERSION, get_build())