Bug 674291 - GoodWeather desklet fails to load data
Summary: GoodWeather desklet fails to load data
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gdesklets-goodweather
Version: 15
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Luya Tshimbalanga
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-01 10:26 UTC by Timur Kristóf
Modified: 2011-11-25 02:32 UTC (History)
5 users (show)

Fixed In Version: gdesklets-goodweather-0.31-8.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-14 00:52:38 UTC
Type: ---


Attachments (Terms of Use)
Patch to __init__.py that makes it work correctly. (1.52 KB, patch)
2011-02-01 11:33 UTC, Timur Kristóf
no flags Details | Diff
Fix regular expressions, fix wind speed output (6.15 KB, patch)
2011-02-20 12:01 UTC, Corinna Vinschen
no flags Details | Diff
Replace "N/A" in temperature output with just a dash (464 bytes, patch)
2011-02-20 12:09 UTC, Corinna Vinschen
no flags Details | Diff
Take 2: Fix regular expressions, fix wind speed output, fix incorrect integer comparison (6.78 KB, patch)
2011-02-20 21:08 UTC, Corinna Vinschen
no flags Details | Diff

Description Timur Kristóf 2011-02-01 10:26:38 UTC
Description of problem:
When I install the gdesklets-goodweather package to Fedora 14 and add the desklet to my desktop, it fails to load any data, regardless of what location I configure in it.

Reproducibility:
always

Steps to Reproduce:
1. install the gdesklets-goodweather package
2. add the desklet to the desktop
3. configure any location
  
Actual results:
It doesn't display any data, just says "loading" for forever.

Expected results:
It should display the actual weather data.

Solution:
After some searching on the net, I found out that weather.com changed the method to get weather data so this is why GoodWeather doesn't work.
To get it work, open /usr/share/gdesklets/Sensors/GoodWeather/__init__.py and change the declaration of WEATHER_SOURCE (beginning on line 42) to this one:

    WEATHER_SOURCE = "http://xoap.weather.com/weather/local/" \
                     "%(weather_code)s?cc=*&dayf=5&prod=xoap&" \
                     "link=xoap&par=1003832479&key=bb12936706a2d601"

After this change, the desklet starts to work correctly. I think it would be best to apply this to the current version found in the repo, so if would work for everyone.

Comment 1 Timur Kristóf 2011-02-01 11:33:28 UTC
Created attachment 476367 [details]
Patch to __init__.py that makes it work correctly.

I discovered another problem. The desklet fails to parse metric data (acquired with &unit=m in the URL), so I created a patch that fixes it by requesting data in fahrenheit. After this, the app is able to convert it successfully to celsius.

Comment 2 Corinna Vinschen 2011-02-20 12:01:06 UTC
Created attachment 479754 [details]
Fix regular expressions, fix wind speed output

Comment 3 Corinna Vinschen 2011-02-20 12:05:53 UTC
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

Comment 4 Corinna Vinschen 2011-02-20 12:09:28 UTC
Created attachment 479755 [details]
Replace "N/A" in temperature output with just a dash

Optional patch to replace the "N/A" string in the output
of temperatures with just a dash.  The reason for this
patch is that the "N/A" string is overly outstanding and
takes too much room and attention.  If a temperature is
not available it should be sufficient to leave the space
"almost" blank.


Corinna

Comment 5 Timur Kristóf 2011-02-20 12:40:46 UTC
Thank you Corinna for your work. Now if only we could ask the packager to include your patches.

Comment 6 Corinna Vinschen 2011-02-20 21:08:01 UTC
Created attachment 479793 [details]
Take 2: Fix regular expressions, fix wind speed output, fix incorrect integer comparison

This is take 2 of the patch to fix the goodweather __init__.py
script.  As it turned out, the script has another bug when it
compares the low and high temperature values.  The variables
are strings, and the comparision neglects to convert the strings
to integer values before comparing them.  This leads to the
unfortunate result that "-1" is less than "-7".  This second
version of the patch is a replacement for patch 479754, which
additionally fixes the comparison of high and low by casting the
variables to int when testing them.


Corinna

Comment 7 Corinna Vinschen 2011-05-29 14:09:30 UTC
What do we do with bug reports to apparently orphaned packages?

The problems reported in this bugzilla entry still exist in Fedora 15
and apparently nobody cares.  I even wrote an email to the guy who
this bug report is assiged to, as well as to extras-qa@fedoraproject.org
to ask how to move forward.  I got no reply in both cases.  Instead,
the entirly unchanged gdesklet-goodweather package made it into F15.

My former entries into this bugzilla entry contain all patches necessary
to fix the issues.


Corinna

Comment 8 Fedora Admin XMLRPC Client 2011-07-20 01:33:08 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 9 Luya Tshimbalanga 2011-07-20 01:41:49 UTC
Corinna,
I take over ownership of this package since I did not have a response of the original owner. Would you like to co-maintain this extension. Regards,

Comment 10 Corinna Vinschen 2011-07-21 10:21:45 UTC
Hi Luya,

thanks for the offer, but I'm already maintaining quite a few
packages.  I would be glad if my patches could go in to improve
the GoodWeather desklet, but I'm not feeling up to the task to
maintain yet another package.


Thanks,
Corinna

Comment 11 Corinna Vinschen 2011-11-07 14:13:53 UTC
Hi Luya,

I just saw that the package is still unchanged for Fedora 16.
Is there any problem why my patches so that they can't go in
to improve the GoodWeather desklet?  The patches are pretty
straightforward and can be applied cleanly to the current sources.


Corinna

Comment 12 Luya Tshimbalanga 2011-11-07 20:19:12 UTC
Hi Corinna,
Sorry for the long delay because I had other priority and lost track about change after cleaning my email. Your patches work greatly. Updates will come shortly.

Comment 13 Fedora Update System 2011-11-07 20:29:15 UTC
gdesklets-goodweather-0.31-7.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/gdesklets-goodweather-0.31-7.fc15

Comment 14 Fedora Update System 2011-11-07 20:29:23 UTC
gdesklets-goodweather-0.31-7.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/gdesklets-goodweather-0.31-7.fc16

Comment 15 Fedora Update System 2011-11-07 20:29:53 UTC
gdesklets-goodweather-0.31-7.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/gdesklets-goodweather-0.31-7.fc14

Comment 16 Fedora Update System 2011-11-10 17:24:46 UTC
Package gdesklets-goodweather-0.31-7.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gdesklets-goodweather-0.31-7.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-15565
then log in and leave karma (feedback).

Comment 17 Corinna Vinschen 2011-11-10 18:31:46 UTC
Hi Luya,

the package works fine for me, but there is a packaging bug.
There are odd files called

  /usr/share/gdesklets/Sensors/GoodWeather/__init__.py.__init__.py
  /usr/share/gdesklets/Sensors/GoodWeather/__init__.py.__init__.pyc
  /usr/share/gdesklets/Sensors/GoodWeather/__init__.py.__init__.pyo
  /usr/share/gdesklets/Sensors/GoodWeather/weather.py.weather

They should be removed before moving from test into release.


Thanks,
Corinna

Comment 18 Fedora Update System 2011-11-13 04:41:31 UTC
gdesklets-goodweather-0.31-8.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/gdesklets-goodweather-0.31-8.fc14

Comment 19 Fedora Update System 2011-11-13 04:42:52 UTC
gdesklets-goodweather-0.31-8.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/gdesklets-goodweather-0.31-8.fc15

Comment 20 Fedora Update System 2011-11-13 04:46:17 UTC
gdesklets-goodweather-0.31-8.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/gdesklets-goodweather-0.31-8.fc16

Comment 21 Fedora Update System 2011-11-14 00:52:38 UTC
gdesklets-goodweather-0.31-8.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 22 Piscium 2011-11-17 21:24:50 UTC
The bug as described is fixed, thanks, however there is still an old bug, that also existed in F13 if not before: if I suspend the computer, and then wake it up, the weather desklet does not update the weather any more. It looks like the thread that does that somehow never wakes up. This is repeatable for me on i686. Any ideas? 

The workaround is to right-click and choose "Restart desklet" - this works.

Comment 23 Luya Tshimbalanga 2011-11-18 03:03:23 UTC
(In reply to comment #22)
> The bug as described is fixed, thanks, however there is still an old bug, that
> also existed in F13 if not before: if I suspend the computer, and then wake it
> up, the weather desklet does not update the weather any more. 

Could you open a new bug report in regards? Thanks.

Comment 24 Piscium 2011-11-19 08:36:48 UTC
(In reply to comment #23)
> Could you open a new bug report in regards? Thanks.

Created bug #755162.

Thanks.

Comment 25 Fedora Update System 2011-11-25 02:20:37 UTC
gdesklets-goodweather-0.31-8.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2011-11-25 02:32:42 UTC
gdesklets-goodweather-0.31-8.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.