Main starts either GUI or TUI. UI split from optima35.

This commit is contained in:
Mr Finchum 2024-12-31 12:06:11 +01:00
parent 1285e5a844
commit 40b7ca0782
3 changed files with 352 additions and 7 deletions

15
main.py
View file

@ -1,8 +1,6 @@
import sys
import os
import subprocess
from argparse import ArgumentParser
exif_file = "local_files/exif.yaml"
# Mainly from ChatGPT
def check_pyside_installed():
try:
@ -17,7 +15,7 @@ def start_gui():
def start_tui():
import tui
tui.main(exif_file)
tui.main(exif_file, tui_settings_file)
def main():
parser = ArgumentParser(description="Start the Optima35 application.")
@ -43,4 +41,13 @@ def main():
start_tui()
if __name__ == "__main__":
if os.path.isfile("config/exif.yaml"):
exif_file = "config/exif.yaml"
elif os.path.isfile("config/exif_example.yaml"):
exif_file = "config/exif_example.yaml"
print("Fall back to exif example file...")
else:
print("Exif file missing, please ensure an exif file exist in config folder (exif.yaml, or exif_example_yaml)\nExiting...")
exit()
tui_settings_file = "config/tui_settings.yaml"
main()