This repository has been archived on 2025-12-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
QWeatherReporter/core/__init__.py

36 lines
820 B
Python
Raw Normal View History

2021-12-15 21:21:39 +08:00
#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2021/12/15
2021-12-15 21:26:36 +08:00
# @File Name: __init__.py
"""
Check the configuration file
"""
2021-12-15 21:59:00 +08:00
import os
2021-12-15 21:26:36 +08:00
import sys
from core.logger import Logger
2021-12-15 21:46:09 +08:00
from core.language import Language
2021-12-15 21:59:00 +08:00
from core.read_config import read_config
2021-12-15 21:26:36 +08:00
2021-12-18 17:03:36 +08:00
2021-12-15 21:59:00 +08:00
settings = read_config()
2021-12-15 21:26:36 +08:00
2021-12-15 21:59:00 +08:00
if not os.path.exists('./logs'):
os.mkdir('./logs')
2021-12-15 21:26:36 +08:00
2021-12-16 21:00:12 +08:00
for mail in settings[0].values():
2021-12-15 21:26:36 +08:00
if not mail:
Logger.critical('mail-settings 有未填写项目')
sys.exit(1)
2021-12-16 21:00:12 +08:00
for request in settings[1].values():
2021-12-15 21:26:36 +08:00
if not request:
Logger.critical('request-settings 有未填写项目')
sys.exit(1)
2021-12-16 21:00:12 +08:00
for other in settings[1].values():
2021-12-15 21:26:36 +08:00
if not other:
Logger.critical('client-settings 有未填写项目')
2021-12-15 21:46:09 +08:00
sys.exit(1)