Bugs item #1591145, was opened at 2006-11-06 06:10
Message generated for change (Comment added) made by duncanwebb
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=446895&aid=1591145&group_id=46652
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: plugins
Group: 1.6.0
>Status: Pending
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Frank Naude (naudefj)
Assigned to: Nobody/Anonymous (nobody)
Summary: Weather download fails - empty visibility
Initial Comment:
Error:
Traceback (most recent call last):
File
"/usr/lib/python2.4/site-packages/freevo/main.py", line
321, in eventhandler
app.eventhandler(event)
File
"/usr/lib/python2.4/site-packages/freevo/menu.py", line
605, in eventhandler
action( arg=arg, menuw=self )
File
"/usr/lib/python2.4/site-packages/freevo/plugins/weather.py",
line 665, in create_locations_menu
locations[0](menuw=menuw)
File
"/usr/lib/python2.4/site-packages/freevo/item.py", line
338, in __call__
return self.actions()[0][0](arg=arg, menuw=menuw)
File
"/usr/lib/python2.4/site-packages/freevo/plugins/weather.py",
line 268, in start_detailed_interface
WeatherDetailHandler(arg, menuw, self)
File
"/usr/lib/python2.4/site-packages/freevo/plugins/weather.py",
line 694, in __init__
skin.draw('weather', self)
File
"/usr/lib/python2.4/site-packages/freevo/skins/main/main.py",
line 537, in draw
a.draw(settings, object, menu, style, type,
self.force_redraw)
File
"/usr/lib/python2.4/site-packages/freevo/skins/main/area.py",
line 201, in draw
self.update_content()
File
"/usr/lib/python2.4/site-packages/freevo/plugins/weather.py",
line 938, in update_content
self.update_functions[self.menu.curSkin]()
File
"/usr/lib/python2.4/site-packages/freevo/plugins/weather.py",
line 801, in update_day
value = self.parent.weather.getVisibility()
File
"/usr/lib/python2.4/site-packages/freevo/plugins/weather.py",
line 260, in getVisibility
if float(self.visibility) == 999.00:
ValueError: empty string for float()
Patch:
Index: freevo-1.6/src/plugins/weather.py
===================================================================
--- freevo-1.6/src/plugins/weather.py (revision 8539)
+++ freevo-1.6/src/plugins/weather.py (working copy)
@@ -257,12 +257,15 @@
return u"%s\xb0 F" % (self.curFeel,)
def getVisibility(self):
- if float(self.visibility) == 999.00:
- return _("Unlimited")
- elif self.convertData:
- return "%s km" % (self.visibility,)
- else:
- return "%s mi" % (self.visibility,)
+ try:
+ if float(self.visibility) == 999.00:
+ return _("Unlimited")
+ elif self.convertData:
+ return "%s km" % (self.visibility,)
+ else:
+ return "%s mi" % (self.visibility,)
+ except ValueError:
+ return None
def start_detailed_interface(self, arg=None,
menuw=None):
WeatherDetailHandler(arg, menuw, self)
----------------------------------------------------------------------
>Comment By: Duncan Webb (duncanwebb)
Date: 2006-11-06 08:22
Message:
Logged In: YES
user_id=104395
Thanks, the patch has been applied to rel-1-6 at r8540.
----------------------------------------------------------------------
Comment By: Frank Naude (naudefj)
Date: 2006-11-06 06:33
Message:
Logged In: YES
user_id=143611
Here is the updated patch.
----------------------------------------------------------------------
Comment By: Frank Naude (naudefj)
Date: 2006-11-06 06:18
Message:
Logged In: YES
user_id=143611
Please do not apply this patch - I will provide a better
patch later today.
PS: this looks like an old problem that wasn't properly fixed:
# Revision .8 2004/02/28 09:19:43 jlaska
# - double check visibility string is not empty when
passing to float()
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=446895&aid=1591145&group_id=46652
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel