重写__init__.py

This commit is contained in:
MarkusJoe
2022-03-03 21:22:48 +08:00
parent 0e27c6faca
commit b0a4cdba2d
1 file changed
+10
+10
View File
@@ -5,5 +5,15 @@
# @Create Time: 2022/2/4 # @Create Time: 2022/2/4
# @File Name: __init__.py.py # @File Name: __init__.py.py
import os
from bin.utils.logger import logger
from bin.utils.settings import Settings
if __name__ != '__main__':
if Settings().type.lower() == 'mysql' and not os.path.exists('./static/origin.sql'):
logger.warning('当前使用的数据库为MySQL请前往 https://themedatabase.vercel.app/source/sql 下载sql文件')
logger.warning('并使用 source 命令来导入MySQL数据库')
logger.warning('此消息只显示一次, 下次启动不显示')
open('./static/origin.sql', 'w').close()
__all__ = ['db'] __all__ = ['db']