Comment 10 for bug 834653

Revision history for this message
In , Corinna (corinna-redhat-bugs) wrote :

I debugged this problem as well and it turns out that it's not at all
a problem with celsius vs. fahrenheit.

Actually, the __init__.py script neglects to take negative values into account
in the regular expressions used to scan the weather data. This breaks the
entire matching routine. The reason that it works for you when using fahrenheit
is simply because the chance to get negative values is lower. If the
fahrenheit value drops below 0, the script will again start to fail.

However, if you add potential matches for + or - in the right spots, it works with all temperatures.

I attached a patch as well. It fixes the broken regular expressions. It
also fixes the "Wind Spped" string and it redefines the output for the wind
speed to add the wind direction as well. So that reads now

  W: 14 kph NE

instead of just

  S: 14 kph

Given that, I replaced the "W:" for the chill with a "C:" since that makes
more sense, IMHO. I also turned the order of high and low temperature of the
day since that order is more natural (day:night).

Btw., I also had the problem that the original WEATHER_SOURCE definition
didn't work for me. However, with the changes in my patch the original
WEATHER_SOURCE definition works for me again. Other than that, if the
WEATHER_SOURCE definition from the original report is preferred, I suggest
to take out the "prod=xoap&link=xoap&" substring. The only result of that
substring in the URL is to add advertisment to the output.

Hope that helps,
Corinna