-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
34 lines (28 loc) · 1.22 KB
/
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
import argparse
import faulthandler
import os
import sys
from PyQt6.QtWidgets import QApplication
from view.hobbitgui import WindowInstaller
from modmanager import ModManager
sys._excepthook = sys.excepthook
def exception_hook(exctype, value, traceback):
print(exctype, value, traceback)
sys._excepthook(exctype, value, traceback)
sys.exit(1)
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog="Hobbit Installer", description="This program install mode for FF8")
parser.add_argument("path", help="Path to FF8 folder", type=str, nargs='?', const=1, default=os.getcwd())
parser.add_argument("-t", "--test", help="For testing purpose", action='store_true')
parser.add_argument("-kdm", "--keep_download_mod", help="Keep downloading mod file", action='store_true')
args = parser.parse_args()
#faulthandler.enable()
sys.excepthook = exception_hook
mod_manager = ModManager(ff8_path=args.path)
app = QApplication.instance()
if not app: # sinon on crée une instance de QApplication
app = QApplication(sys.argv)
if app.style().objectName() == "windows11":
app.setStyle("Fusion")
window_installer = WindowInstaller(mod_manager)
sys.exit(app.exec())