Version eingebaut
This commit is contained in:
parent
0b79cc99ad
commit
98d9a84031
2 changed files with 16 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
#V0.1.1b @MAC
|
#V0.1.1b @PC
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
@ -10,8 +10,17 @@ import random
|
||||||
import shutil
|
import shutil
|
||||||
import logging
|
import logging
|
||||||
from logging.handlers import RotatingFileHandler
|
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):
|
def setup_logging(app_dir, level=logging.INFO, console=True):
|
||||||
logging.getLogger("httpx").setLevel(logging.WARNING)
|
logging.getLogger("httpx").setLevel(logging.WARNING)
|
||||||
log_file = app_dir / "Simbriefimport.log"
|
log_file = app_dir / "Simbriefimport.log"
|
||||||
|
|
@ -467,7 +476,7 @@ ordnerneu.mkdir(exist_ok=True)
|
||||||
logging.info("--------------------------------------------------")
|
logging.info("--------------------------------------------------")
|
||||||
logging.info("START .txt Erzeugung ")
|
logging.info("START .txt Erzeugung ")
|
||||||
logging.info("--------------------------------------------------")
|
logging.info("--------------------------------------------------")
|
||||||
debug = False
|
debug = True
|
||||||
if debug == False:
|
if debug == False:
|
||||||
metarCabin = METAR()
|
metarCabin = METAR()
|
||||||
metar = metarCabin.choices[0].message.content
|
metar = metarCabin.choices[0].message.content
|
||||||
|
|
@ -534,3 +543,5 @@ if debug == False:
|
||||||
logging.info("--------------------------------------------------")
|
logging.info("--------------------------------------------------")
|
||||||
logging.info(" F E R T S C H ")
|
logging.info(" F E R T S C H ")
|
||||||
logging.info("--------------------------------------------------")
|
logging.info("--------------------------------------------------")
|
||||||
|
|
||||||
|
logging.info("Version: %s.%s", VERSION, get_build())
|
||||||
|
|
|
||||||
1
version.py
Normal file
1
version.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
VERSION = "0.1.1b"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue