-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (36 loc) · 990 Bytes
/
Copy pathmain.py
File metadata and controls
40 lines (36 loc) · 990 Bytes
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
import configparser
from pathlib import Path
import sys
import os
config_path = Path(__file__).parent / "config.ini"
config = configparser.ConfigParser()
def create_defaults():
if not config_path.exists():
config["App"] = {
"theme": "auto",
"language": "en"
}
config["Window"] = {
"width": "420",
"height": "400",
"x": "100",
"y": "100"
}
config["Path"] = {
"server_path": str(Path.home() / "RustServer")
}
with open(config_path, "w") as f:
config.write(f)
print("config.ini created with defaults")
else:
print("config.ini already exists, skipping.")
def run():
create_defaults()
from src.gui.maingui import MainWindow
from PyQt6.QtWidgets import QApplication
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
run()