-
Notifications
You must be signed in to change notification settings - Fork 1
/
reset.py
29 lines (22 loc) · 850 Bytes
/
reset.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
#!/usr/bin/env python3
import oa_core as core
import theme
def setting(skip_setup: bool = True) -> None:
with open("resource/setting/default_setting.json", encoding="utf-8_sig") as f:
default_setting = f.read()
with open("resource/setting/setting.json", mode="w", encoding="utf-8_sig") as f:
f.write(default_setting)
if skip_setup:
core.write_setting("resource/setting/setting.json",
"setup_finished", True)
theme.change("theme/auto_theme.css")
return
def flag() -> None:
with open("resource/setting/default_flag.json", encoding="utf-8_sig") as f:
default_setting = f.read()
with open("resource/setting/flag.json", mode="w", encoding="utf-8_sig") as f:
f.write(default_setting)
return
def factory_reset() -> None:
setting(False)
flag()