mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2025-12-16 22:05:12 +00:00
feat: auto-generate MCE/config.json
This commit is contained in:
parent
ea2b9d67cd
commit
dd5e6d7803
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"ResetDaily": false,
|
|
||||||
"LastRun": "2023-12-24 21:41:55",
|
|
||||||
"ResetTime": "11:21:30",
|
|
||||||
"RechargeAP": true,
|
|
||||||
"PreferredTemplate": "template1",
|
|
||||||
"Queue": [],
|
|
||||||
"Event": false,
|
|
||||||
"Templates": {
|
|
||||||
"template1": []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
19
MCE/utils.py
19
MCE/utils.py
@ -1,12 +1,29 @@
|
|||||||
import customtkinter
|
import customtkinter
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
from MCE.custom_widgets.ctk_notification import CTkNotification
|
import os
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
def __init__(self, linker, config_file):
|
def __init__(self, linker, config_file):
|
||||||
|
self.default_config = {
|
||||||
|
"ResetDaily": False,
|
||||||
|
"LastRun": "2023-12-24 21:41:55",
|
||||||
|
"ResetTime": "11:21:30",
|
||||||
|
"RechargeAP": False,
|
||||||
|
"PreferredTemplate": "template1",
|
||||||
|
"Queue": [],
|
||||||
|
"Event": False,
|
||||||
|
"Templates": {
|
||||||
|
"template1": []
|
||||||
|
}
|
||||||
|
}
|
||||||
self.linker = linker
|
self.linker = linker
|
||||||
self.config_file = config_file
|
self.config_file = config_file
|
||||||
|
|
||||||
|
if not os.path.exists(self.config_file):
|
||||||
|
with open(self.config_file, "w") as f:
|
||||||
|
json.dump(self.default_config, f, indent=2)
|
||||||
|
|
||||||
self.config_data = self.read()
|
self.config_data = self.read()
|
||||||
self.linker.widgets = self.set_values_to_none(self.config_data)
|
self.linker.widgets = self.set_values_to_none(self.config_data)
|
||||||
self.locked = False
|
self.locked = False
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
},
|
},
|
||||||
"Mission": {
|
"Mission": {
|
||||||
"name": "Mission/Commissions/Event",
|
"name": "Mission/Commissions/Event",
|
||||||
"help": "Open MCE Manager for additional settings"
|
"help": "Open MCE Manager for additional settings. Must be opened if it's your first time!"
|
||||||
},
|
},
|
||||||
"Circle": {
|
"Circle": {
|
||||||
"name": "Club",
|
"name": "Club",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user