@@ -97,7 +97,7 @@ def get_weather(city, code):
97
97
temp_now = f"实时温度:{ info_2_json ['now' ]['temp' ]} ℃\n "
98
98
humidity = f"湿 度:{ info_2_json ['now' ]['humidity' ]} %\n "
99
99
wind_direction = f"风 向:{ info_2_json ['now' ]['windDir' ]} \n "
100
- wind_speed = f"风 力:{ info_2_json ['now' ]['windSpeed ' ]} 级\n "
100
+ wind_speed = f"风 力:{ info_2_json ['now' ]['windScale ' ]} 级\n "
101
101
air_pollution = f"空气污染:{ air_json ['daily' ][0 ]['category' ]} \n "
102
102
weather = f"天 气:{ info_2_json ['now' ]['text' ]} \n "
103
103
settings = read_settings ()
@@ -238,7 +238,7 @@ def getWeather(self):
238
238
try :
239
239
citycode = get_code (self .table , city )
240
240
except KeyError :
241
- logging .info (f"输入错误:{ city } " )
241
+ logging .warning (f"输入错误:{ city } " )
242
242
err_msg = "输入错误"
243
243
# logging.info(citycode)
244
244
# logging.info(f"错误:{city}")
@@ -251,16 +251,16 @@ def getWeather(self):
251
251
logging .info (f"查询:{ city } -{ citycode } \n [{ info } ]" )
252
252
except requests .ConnectionError :
253
253
err_msg = "网络错误"
254
- logging .error (f"网络错误:{ city } 请检查网络连接" )
254
+ logging .warning (f"网络错误:{ city } 请检查网络连接" )
255
255
except JSONDecodeError :
256
256
err_msg = "输入错误"
257
- logging .error (f"输入错误:{ city } 请检查输入" )
257
+ logging .warning (f"输入错误 JSONDecodeError :{ city } 请检查输入" )
258
258
except KeyError :
259
259
err_msg = "输入错误"
260
- logging .error (f"输入错误:{ city } 请检查输入" )
260
+ logging .warning (f"输入错误 KeyError :{ city } 请检查输入" )
261
261
except :
262
262
err_msg = "未知错误"
263
- logging .error (traceback .format_exc ())
263
+ logging .warning (traceback .format_exc ())
264
264
if not err_msg :
265
265
self .lineEdit .setFocus ()
266
266
self .textEdit .setText (info )
0 commit comments