From 72135ea0ed86242b2271d437b76b2eacd5f4a6e5 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Wed, 22 Feb 2012 15:40:26 -0500 Subject: [PATCH] tfw: everything is more fun with unicode --- modules/tfw.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/tfw.py b/modules/tfw.py index 5ecf108..11773d4 100644 --- a/modules/tfw.py +++ b/modules/tfw.py @@ -1,4 +1,5 @@ #!/usr/bin/python3 +# -*- coding: utf-8 -*- """ tfw.py - the fucking weather module author: mutantmonkey @@ -45,16 +46,15 @@ def tfw(phenny, input, fahrenheit=False, celsius=False): if c.isdigit() or c == '-': tempt += c temp = int(tempt) - deg = chr(176) # add units and convert if necessary if fahrenheit: - temp = "%d%cF?!" % (temp, deg) + temp = "{0:d}°F‽".format(temp) elif celsius: - temp = "%d%cC?!" % (temp, deg) + temp = "{0:d}°C‽".format(temp) else: tempev = (temp + 273.15) * 8.617343e-5 * 1000 - temp = "%f meV?!" % tempev + temp = "%f meV‽" % tempev # parse comment (broken by
, so we have do it this way) comments = main[0].xpath('text()')