You've already forked QWeatherReporter
feat: added some comments
This commit is contained in:
@@ -10,6 +10,10 @@ import json
|
||||
|
||||
|
||||
def Language():
|
||||
"""
|
||||
读取配置文件中的语言选项并返回相对因的语言文件的读取结果
|
||||
:return:
|
||||
"""
|
||||
with open('./config.yml', 'r', encoding='utf-8') as lang:
|
||||
config = YAML().load(lang.read())
|
||||
language_sel = config['client-settings']['language']
|
||||
|
||||
@@ -10,10 +10,11 @@ from ruamel.yaml import YAML
|
||||
|
||||
def read_config():
|
||||
"""
|
||||
|
||||
读取配置文件并返回读取到的内容同
|
||||
:return: mail-settings, request-settings, client-settings, only-view-settings --> 0, 1, 2, 3
|
||||
"""
|
||||
with open('./config.yml', 'r') as conf:
|
||||
config_file = 'config.yml'
|
||||
with open(f'./{config_file}', 'r') as conf:
|
||||
config = YAML().load(conf.read())
|
||||
mail_settings = config['mail-settings']
|
||||
request_settings = config['request-settings']
|
||||
|
||||
@@ -12,7 +12,7 @@ from core.language import Language
|
||||
|
||||
def read_excel(kw: str):
|
||||
"""
|
||||
Read xlsx file and return searched results
|
||||
读取china_city_list.xlsx并搜索匹配关键字的结果并输出到终端
|
||||
:param kw: keyword
|
||||
:return: city_list
|
||||
"""
|
||||
|
||||
@@ -39,6 +39,10 @@ class Mail:
|
||||
self.smtp = smtplib.SMTP(self.server, self.port) # 登录邮箱服务器 不使用SSL连接
|
||||
|
||||
def dev_version(self):
|
||||
"""
|
||||
开发者版本
|
||||
:return:
|
||||
"""
|
||||
dev_weather = WeatherInfo().dev_version()
|
||||
dates = dev_weather[0]
|
||||
day_weathers = dev_weather[1]
|
||||
@@ -203,6 +207,10 @@ class Mail:
|
||||
sys.exit(1)
|
||||
|
||||
def free_version(self):
|
||||
"""
|
||||
免费版本
|
||||
:return:
|
||||
"""
|
||||
free_weather = WeatherInfo().free_version()
|
||||
dates = free_weather[0]
|
||||
day_weathers = free_weather[1]
|
||||
@@ -342,6 +350,10 @@ class Mail:
|
||||
sys.exit(1)
|
||||
|
||||
def warning_(self):
|
||||
"""
|
||||
自然灾害预警
|
||||
:return:
|
||||
"""
|
||||
info = WeatherInfo().warning_()
|
||||
release_time = info[0]
|
||||
title = info[1]
|
||||
|
||||
Reference in New Issue
Block a user