messages improved

This commit is contained in:
Martin Brodbeck 2021-08-12 15:08:33 +02:00
parent 51188ee03d
commit d70b08533b
1 changed files with 3 additions and 6 deletions

View File

@ -13,10 +13,6 @@ GMT = ''
def get_famid_name_from_imgfile(imgfile_path):
if os.path.isfile(imgfile_path) == False:
sys.exit("Datei nicht gefunden. Bitte geben Sie eine gültige .img-Datei an.")
# fid = subprocess.run(f'{GMT} -i {imgfile_path} | grep ", FID " | cut -d\',\' -f 2 | sed -e \'s/ FID //\'',
# shell=True, capture_output=True, text=True).stdout.strip()
# name = subprocess.run(f'{GMT} -i {imgfile_path} | grep ", FID " | cut -d\',\' -f 3 | sed -e \'s/ //\'',
# shell=True, capture_output=True, text=True).stdout.strip()
# output = subprocess.run(
# [f'{GMT} -i "{imgfile_path}"'], shell=True, capture_output=True, text=True).stdout
@ -30,7 +26,7 @@ def get_famid_name_from_imgfile(imgfile_path):
match = re.search(pattern, output)
if not match:
sys.exit(
f"Keine gültige gmapsupp-Datei: {imgfile_path}\nBitte geben Sie eine gültige Datei an.")
f"Keine gültige gmapsupp-Datei!\nBitte geben Sie eine valide Datei für Garmin/QMapShack an.")
fid = str(match.group(1), 'UTF-8').strip()
name = str(match.group(2), 'UTF-8').strip()
@ -124,7 +120,8 @@ def ask_for_visualization():
def main():
parser = argparse.ArgumentParser(
description='Das Programm passt die Darstellung der Garmin-"Speichenkarte" an. ')
description='Das Programm passt die Darstellung der "Speichenkarte" '
'für Garmin-Geräte/QMapShack an. ')
parser.add_argument('imgfile', type=str, help='Garmin gmapsupp-Datei')
parser.add_argument('-t', '--typdir', type=str,
help='Verzeichnis mit den TYP-Dateien')