[ASLO] Problem with Log activity - Sugar widgets

Alan Jhonn Aguiar Schwyn alanjas at hotmail.com
Fri Mar 2 15:42:11 EST 2012



Hi,
Some time ago I make this ticket:
http://bugs.sugarlabs.org/ticket/3328
The problem is:
3	Traceback (most recent call last):4	  File "/usr/bin/sugar-activity", line 21, in <module>5	    main.main()6	  File "/usr/lib/python2.6/site-packages/sugar/activity/main.py", line 152, in main7	    create_activity_instance(activity_constructor, activity_handle)8	  File "/usr/lib/python2.6/site-packages/sugar/activity/main.py", line 37, in create_activity_instance9	    activity = constructor(handle)10	  File "/home/olpc/Activities/Log.activity/logviewer.py", line 363, in __init__11	    self._build_toolbox()12	  File "/home/olpc/Activities/Log.activity/logviewer.py", line 372, in _build_toolbox13	    activity_button = ActivityToolbarButton(self)14	  File "/usr/lib/python2.6/site-packages/sugar/activity/widgets.py", line 74, in __init__15	    icon = _create_activity_icon(activity.metadata)16	  File "/usr/lib/python2.6/site-packages/sugar/activity/widgets.py", line 37, in _create_activity_icon17	    if metadata.get('icon-color', ''):18	AttributeError: 'NoneType' object has no attribute 'get'
I think this: If is the first time that you open the activity, the metadata is None...
How nobody solve it, I propose this  QUICK SOLUTION:
in the file  "/usr/lib/python2.6/site-packages/sugar/activity/widgets.py" :
with the "short circuit if":
    if metadata and metadata.get('icon-color', ''):            color = XoColor(metadata['icon-color'])    else:        client = gconf.client_get_default()        color = XoColor(client.get_string('/desktop/sugar/user/color'))
This problem can solve some error in others activities...
What are your opinions?
Regards!
Alan








 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/aslo/attachments/20120302/05ad8e9e/attachment.html>


More information about the ASLO mailing list