Changed capitalization of eV.
Even though Volt units are capitalized V, when you write code apparently conventions older than computers themselves are rejected in favour of newer conventions.master
parent
9248b6721c
commit
b73a048541
|
@ -42,7 +42,7 @@ class TestTfw(unittest.TestCase):
|
||||||
|
|
||||||
def test_mev(self):
|
def test_mev(self):
|
||||||
input = Mock(group=lambda x: '24060')
|
input = Mock(group=lambda x: '24060')
|
||||||
tfw.tfweV(self.phenny, input)
|
tfw.tfwev(self.phenny, input)
|
||||||
|
|
||||||
out = self.phenny.say.call_args[0][0]
|
out = self.phenny.say.call_args[0][0]
|
||||||
m = re.match('^[\-\d\.]+ meV‽ .* \- .* \- [A-Z]{4} \d{2}:\d{2}Z$', out,
|
m = re.match('^[\-\d\.]+ meV‽ .* \- .* \- [A-Z]{4} \d{2}:\d{2}Z$', out,
|
||||||
|
|
|
@ -15,7 +15,7 @@ import metar
|
||||||
import web
|
import web
|
||||||
|
|
||||||
|
|
||||||
def tfw(phenny, input, fahrenheit=False, celsius=False, meV=False):
|
def tfw(phenny, input, fahrenheit=False, celsius=False, mev=False):
|
||||||
""".tfw <city/zip> - Show the fucking weather at the specified location."""
|
""".tfw <city/zip> - Show the fucking weather at the specified location."""
|
||||||
|
|
||||||
where = input.group(2)
|
where = input.group(2)
|
||||||
|
@ -50,7 +50,7 @@ def tfw(phenny, input, fahrenheit=False, celsius=False, meV=False):
|
||||||
temp = "{0:d}°F‽".format(int(tempf))
|
temp = "{0:d}°F‽".format(int(tempf))
|
||||||
elif celsius:
|
elif celsius:
|
||||||
temp = "{0:d}°C‽".format(w.temperature)
|
temp = "{0:d}°C‽".format(w.temperature)
|
||||||
elif meV:
|
elif mev:
|
||||||
tempev = (w.temperature + 273.15) * 8.617343e-5 * 1000
|
tempev = (w.temperature + 273.15) * 8.617343e-5 * 1000
|
||||||
temp = "%f meV‽" % tempev
|
temp = "%f meV‽" % tempev
|
||||||
else:
|
else:
|
||||||
|
@ -208,10 +208,10 @@ def tfwc(phenny, input):
|
||||||
return tfw(phenny, input, celsius=True)
|
return tfw(phenny, input, celsius=True)
|
||||||
tfwc.rule = (['tfwc'], r'(.*)')
|
tfwc.rule = (['tfwc'], r'(.*)')
|
||||||
|
|
||||||
def tfweV(phenny, input):
|
def tfwev(phenny, input):
|
||||||
""".tfwc <city/zip> - The fucking weather, in fucking degrees celsius."""
|
""".tfwc <city/zip> - The fucking weather, in fucking degrees celsius."""
|
||||||
return tfw(phenny, input, meV=True)
|
return tfw(phenny, input, mev=True)
|
||||||
tfweV.rule = (['tfweV', 'tfwev'], r'(.*)')
|
tfwev.rule = (['tfwev'], r'(.*)')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print(__doc__.strip())
|
print(__doc__.strip())
|
||||||
|
|
Loading…
Reference in New Issue