feat(core): 完成配置类初始化任务

This commit is contained in:
DLmaster361
2025-08-04 00:01:34 +08:00
parent 5f57ce54aa
commit a4891131fc
10 changed files with 1851 additions and 362 deletions

View File

@@ -390,6 +390,11 @@ class MultipleConfig:
配置文件路径,必须为 JSON 文件,如果不存在则会创建
"""
if path.suffix != ".json":
raise ValueError(
"The config file must be a JSON file with '.json' extension."
)
self.file = path
if not self.file.exists():

27
app/models/__init__.py Normal file
View File

@@ -0,0 +1,27 @@
# AUTO_MAA:A MAA Multi Account Management and Automation Tool
# Copyright © 2024-2025 DLmaster361
# This file is part of AUTO_MAA.
# AUTO_MAA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
# AUTO_MAA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with AUTO_MAA. If not, see <https://www.gnu.org/licenses/>.
# Contact: DLmaster_361@163.com
__version__ = "5.0.0"
__author__ = "DLmaster361 <DLmaster_361@163.com>"
__license__ = "GPL-3.0 license"
from .ConfigBase import *
__all__ = ["ConfigBase"]