<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<div><br></div><div>Hi,</div><div><br></div><div>Some time ago I make this ticket:</div><div><br></div><div><a href="http://bugs.sugarlabs.org/ticket/3328">http://bugs.sugarlabs.org/ticket/3328</a></div><div><br></div><div>The problem is:</div><div><br></div><div><div>3<span class="Apple-tab-span" style="white-space:pre"> </span>Traceback (most recent call last):</div><div>4<span class="Apple-tab-span" style="white-space:pre"> </span> File "/usr/bin/sugar-activity", line 21, in <module></div><div>5<span class="Apple-tab-span" style="white-space:pre"> </span> main.main()</div><div>6<span class="Apple-tab-span" style="white-space:pre"> </span> File "/usr/lib/python2.6/site-packages/sugar/activity/main.py", line 152, in main</div><div>7<span class="Apple-tab-span" style="white-space:pre"> </span> create_activity_instance(activity_constructor, activity_handle)</div><div>8<span class="Apple-tab-span" style="white-space:pre"> </span> File "/usr/lib/python2.6/site-packages/sugar/activity/main.py", line 37, in create_activity_instance</div><div>9<span class="Apple-tab-span" style="white-space:pre"> </span> activity = constructor(handle)</div><div>10<span class="Apple-tab-span" style="white-space:pre"> </span> File "/home/olpc/Activities/Log.activity/logviewer.py", line 363, in __init__</div><div>11<span class="Apple-tab-span" style="white-space:pre"> </span> self._build_toolbox()</div><div>12<span class="Apple-tab-span" style="white-space:pre"> </span> File "/home/olpc/Activities/Log.activity/logviewer.py", line 372, in _build_toolbox</div><div>13<span class="Apple-tab-span" style="white-space:pre"> </span> activity_button = ActivityToolbarButton(self)</div><div>14<span class="Apple-tab-span" style="white-space:pre"> </span> File "/usr/lib/python2.6/site-packages/sugar/activity/widgets.py", line 74, in __init__</div><div>15<span class="Apple-tab-span" style="white-space:pre"> </span> icon = _create_activity_icon(activity.metadata)</div><div>16<span class="Apple-tab-span" style="white-space:pre"> </span> File "/usr/lib/python2.6/site-packages/sugar/activity/widgets.py", line 37, in _create_activity_icon</div><div>17<span class="Apple-tab-span" style="white-space:pre"> </span> if metadata.get('icon-color', ''):</div><div>18<span class="Apple-tab-span" style="white-space:pre"> </span>AttributeError: 'NoneType' object has no attribute 'get'</div></div><div><br></div><div>I think this: If is the first time that you open the activity, the metadata is None...</div><div><br></div><div>How nobody solve it, I propose this <span style="font-size: 10pt; "> QUICK SOLUTION:</span></div><div><br></div><div>in the file <span style="font-size: 10pt; "> </span><span style="font-size: 10pt; ">"/usr/lib/python2.6/site-packages/sugar/activity/widgets.py" :</span></div><div><span style="font-size: 10pt; "><br></span></div><div>with the "short circuit if":</div><div><span style="font-size: 10pt; "><br></span></div><div><span style="font-size: 10pt; "><div> if metadata and<span style="font-size: 10pt; "> metadata.get('icon-color', ''):</span></div><div> color = XoColor(metadata['icon-color'])</div><div> else:</div><div> client = gconf.client_get_default()</div><div> color = XoColor(client.get_string('/desktop/sugar/user/color'))</div><div><br></div><div>This problem can solve some error in others activities...</div><div><br></div><div>What are your opinions?</div><div><br></div><div>Regards!</div><div><br></div><div>Alan</div><div><br></div></span></div><div><span style="font-size: 10pt; "><br></span></div><div><span style="font-size: 10pt; "><br></span></div><div><span style="font-size: 10pt; "><br></span></div><div><span style="font-size: 10pt; "><br></span></div><div><span style="font-size: 10pt; "><br></span></div><div><span style="font-size: 10pt; "><br></span></div><div><br></div><div><br></div> </div></body>
</html>