dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 7c791b3090095d94ffd2f6c34db8ae9b3865dce2
parent 5aadf15cdbf5e13b8c7b72f80dcd63082a264666
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat, 27 Jun 2020 07:09:51 -0400

weather.py: remove UTF-8 degree codepoint

Diffstat:
Mlib/forecastio/weather.py | 11++---------
1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/lib/forecastio/weather.py b/lib/forecastio/weather.py @@ -54,13 +54,7 @@ def generate_forecast(): current_temp = forecast.currently() day = forecast.daily() - if 'LANG' in os.environ and \ - os.environ['LANG'].find('UTF-8') != -1: - degree_symbol = "\u00b0" - else: - degree_symbol = "" - - temp = str(current_temp.temperature) + degree_symbol + " F" + temp = str(current_temp.temperature) + "F" high = str(int(math.ceil(day.data[0].temperatureMax))) low = str(int(math.ceil(day.data[0].temperatureMin))) @@ -71,8 +65,7 @@ def generate_forecast(): with open(out_filename, 'w') as outfile: outfile.write(temp + ", " + str(current_temp.summary) + \ - ", " + high + degree_symbol + "/" +low + \ - degree_symbol + " F") + ", " + high + "/" +low + "F") except requests.exceptions.ConnectionError: error = True sys.stdout.writelines(