Difficult-Rocket/Difficult_Rocket/mod/loader/__init__.py

41 lines
1.1 KiB
Python
Raw Normal View History

2022-02-16 13:36:26 +08:00
# -------------------------------
# Difficult Rocket
2023-01-20 14:08:12 +08:00
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
2022-02-16 13:36:26 +08:00
# All rights reserved
# -------------------------------
2023-04-23 21:56:28 +08:00
2023-06-10 18:08:40 +08:00
import logging
from pathlib import Path
from typing import List, Dict, Optional
2023-04-23 21:56:28 +08:00
from Difficult_Rocket.api.screen import BaseScreen
2023-06-10 18:08:40 +08:00
from Difficult_Rocket.api.types import Options, Version
from Difficult_Rocket.mod.api import ModInfo
2023-06-16 23:36:24 +08:00
# from Difficult_Rocket import DR_status, DR_runtime
2023-06-10 18:08:40 +08:00
class ModManager(Options):
name = 'Mod Manager'
mods_path: List[Path] = [Path('./mods')]
loaded_mod_modules: Dict[str, ModInfo] = {}
2023-04-23 21:56:28 +08:00
2023-06-10 18:08:40 +08:00
def find_mods(self) -> List[Path]:
"""
查找mods文件夹下的所有mod
:return:
"""
mods = []
for path in self.mods_path:
if not path.exists():
path.mkdir(parents=True)
continue
for mod in path.iterdir():
...
2023-04-23 21:56:28 +08:00
2023-06-10 18:08:40 +08:00
def init(self) -> None:
self.logger = logging.getLogger('client')
self.logger.name = 'mod_manager'
self.logger.info('Mod Manager init')
2023-04-23 21:56:28 +08:00