-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfiguration.py
48 lines (37 loc) · 984 Bytes
/
configuration.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
import configparser
def read_config():
print("reading")
cfg = configparser.ConfigParser()
with open("piktool.ini", "r") as f:
cfg.read_file(f)
print("read")
return cfg
def make_default_config():
cfg = configparser.ConfigParser()
cfg["default paths"] = {
"routes": "",
"collision": "",
"gen": ""
}
cfg["routes editor"] = {
"DefaultRadius": "50",
"InvertZoom": "False",
"GroundWaypointsWhenMoving": "False"
}
cfg["gen editor"] = {
"InvertZoom": "False",
"GroundObjectsWhenMoving": "False",
"GroundObjectsWhenAdding": "True",
"wasdscrolling_speed": "200",
"wasdscrolling_speedupfactor": "3"
}
cfg["model render"] = {
"Width": "2000",
"Height": "2000"
}
with open("piktool.ini", "w") as f:
cfg.write(f)
return cfg
def save_cfg(cfg):
with open("piktool.ini", "w") as f:
cfg.write(f)