weather: use ** for bold rather than irc codes

This commit is contained in:
Brian S. Stephan 2018-01-09 11:01:49 -06:00
parent 138a0cdc2a
commit 9c551d37a0
1 changed files with 9 additions and 9 deletions

View File

@ -57,7 +57,7 @@ def get_conditions_for_query(queryitems):
else:
try:
location = current['display_location']['full']
reply = "Conditions for {0:s}: ".format(location)
reply = "Conditions for **{0:s}**: ".format(location)
weather_str = current['weather']
if weather_str != '':
@ -85,35 +85,35 @@ def get_conditions_for_query(queryitems):
humidity_str = current['relative_humidity']
if humidity_str != '':
reply += "Humidity: {0:s}. ".format(humidity_str)
reply += "**Humidity**: {0:s}. ".format(humidity_str)
wind_str = current['wind_string']
if wind_str != '':
reply += "Wind: {0:s}. ".format(wind_str)
reply += "**Wind**: {0:s}. ".format(wind_str)
pressure_in = current['pressure_in']
pressure_trend = current['pressure_trend']
if pressure_in != '':
reply += "Pressure: {0:s}\"".format(pressure_in)
reply += "**Pressure**: {0:s}\"".format(pressure_in)
if pressure_trend != '':
reply += " and {0:s}".format("dropping" if pressure_trend == '-' else "rising")
reply += ". "
heat_index_str = current['heat_index_string']
if heat_index_str != '' and heat_index_str != 'NA':
reply += "Heat index: {0:s}. ".format(heat_index_str)
reply += "**Heat index**: {0:s}. ".format(heat_index_str)
windchill_str = current['windchill_string']
if windchill_str != '' and windchill_str != 'NA':
reply += "Wind chill: {0:s}. ".format(windchill_str)
reply += "**Wind chill**: {0:s}. ".format(windchill_str)
visibility_mi = current['visibility_mi']
if visibility_mi != '':
reply += "Visibility: {0:s} miles. ".format(visibility_mi)
reply += "**Visibility**: {0:s} miles. ".format(visibility_mi)
precip_in = current['precip_today_in']
if precip_in != '':
reply += "Precipitation today: {0:s}\". ".format(precip_in)
reply += "**Precipitation today**: {0:s}\". ".format(precip_in)
observation_time = current['observation_time']
if observation_time != '':
@ -174,7 +174,7 @@ def get_forecast_for_query(queryitems):
try:
reply = "Forecast: "
for forecast in forecasts['forecastday'][0:5]:
reply += "{0:s}: {1:s} ".format(forecast['title'],
reply += "**{0:s}**: {1:s} ".format(forecast['title'],
forecast['fcttext'])
return _prettify_weather_strings(reply.rstrip())