-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
36 lines (25 loc) · 845 Bytes
/
main.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
import argparse
from source.option import Options
from source.translation import load_language
options = Options.from_file("./option.json")
translater = load_language(options.language.get())
window = None
def main_gui():
global window
from source.interface.gui import install
window = install.Window(options)
window.run()
def main_cli(argparser: argparse.ArgumentParser):
from source.interface.cli import install
install.cli(options, argparser)
argparser = argparse.ArgumentParser()
argparser.add_argument(
"-i", "--interface",
choices=["gui", "cli"],
default="gui",
help="should the installer be started with a graphical interface or with the command line interface"
)
args, _ = argparser.parse_known_args()
match args.interface:
case "gui": main_gui()
case "cli": main_cli(argparser)