mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 03:15:06 +08:00
* style: remove necessary imports * style: fix F841 * style: fix F401 * style: fix F811 * style: fix E402 * style: fix E721 * style: fix E722 * style: fix E722 * style: fix F541 * style: ruff format * style: all passed * style: add ruff in deps * style: more ignores in ruff.toml * style: add pre-commit
35 lines
645 B
Python
35 lines
645 B
Python
import abc
|
|
|
|
|
|
class ConfigFile(metaclass=abc.ABCMeta):
|
|
"""配置文件抽象类"""
|
|
|
|
config_file_name: str = None
|
|
"""配置文件名"""
|
|
|
|
template_file_name: str = None
|
|
"""模板文件名"""
|
|
|
|
template_data: dict = None
|
|
"""模板数据"""
|
|
|
|
@abc.abstractmethod
|
|
def exists(self) -> bool:
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
async def create(self):
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
async def load(self, completion: bool = True) -> dict:
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
async def save(self, data: dict):
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
def save_sync(self, data: dict):
|
|
pass
|