-
Notifications
You must be signed in to change notification settings - Fork 21
/
dcs_wp_editor.py
56 lines (43 loc) · 1.28 KB
/
dcs_wp_editor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from configparser import ConfigParser
from src.logger import get_logger, log_settings
from src.wp_editor import WaypointEditor
from src.gui import GUI, exception_gui, check_version
from src.first_setup import first_time_setup
from src.objects import generate_default_bases
import traceback
import logging
from pyproj import datadir, _datadir
version = "v1.0.0b1"
def main():
try:
open("settings.ini", "r").close()
first_time = False
except FileNotFoundError:
first_time = True
update_exit = check_version(version)
if update_exit:
return
setup_completed = not first_time or first_time_setup()
if setup_completed:
generate_default_bases()
log_settings(version)
settings = ConfigParser()
settings.read("settings.ini")
editor = WaypointEditor(settings)
gui = GUI(editor, version)
try:
gui.run()
except Exception:
gui.close()
raise
if __name__ == "__main__":
logger = get_logger("root")
logger.info("Initializing")
try:
main()
except Exception as e:
logger.error("Exception occurred", exc_info=True)
logging.shutdown()
exception_gui(traceback.format_exc())
raise
logger.info("Finished")