Okay - sounds good.&nbsp; Is there an api listing of the calls available (or soon to be available)?&nbsp; Or are they listed somewhere in the sugar source code?<br><br><br><div><span class="gmail_quote">On 9/6/06, <b class="gmail_sendername">
Dan Williams</b> &lt;<a href="mailto:dcbw@redhat.com">dcbw@redhat.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Wed, 2006-09-06 at 09:34 -0400, Dan Williams wrote:
<br>&gt; On Wed, 2006-09-06 at 00:41 +0200, Marco Pesenti Gritti wrote:<br>&gt; &gt; Erik Blankinship wrote:<br>&gt; &gt; &gt; Below is a simple sugar app and the log it creates when run on today's<br>&gt; &gt; &gt; build.
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; There appears to be a problem with:<br>&gt; &gt; &gt; [1] AttributeError: 'crop' object has no attribute '_activity_type'<br>&gt; &gt; &gt; and<br>&gt; &gt; &gt; [2] AttributeError: 'NoneType' object has no attribute 'get_name'
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; If I remove the Presence calls (just the gtk button), I don't get<br>&gt; &gt; &gt; these errors.&nbsp;&nbsp;Any ideas?&nbsp;&nbsp;Thanks.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; import gtk<br>
&gt; &gt; &gt;<br>&gt; &gt; &gt; from sugar.activity.Activity import Activity<br>&gt; &gt; &gt; from sugar.presence import PresenceService<br>&gt; &gt; &gt; import logging<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; class crop(Activity):
<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; def __init__(self):<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Activity.__init__(self)<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; button = gtk.Button('Why am I busted?')<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.add(button)<br>
&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; button.show()<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._ps = PresenceService.get_instance()<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; me = self._ps.get_owner()<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name = me.get_name()
<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logging.info(&quot;I am %s&quot; % name)<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; activities = self._ps.get_activities()<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for act in activities:<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logging.info
(&quot;Activity: %s&quot; % act.get_id())<br>&gt; &gt;<br>&gt; &gt; The presence service owner is initialized asynchronously, so it's<br>&gt; &gt; usually None when then presence service has just been instantiated. Dan<br>
&gt; &gt; should know the details...<br>&gt;<br>&gt; Yeah, there should probably be a way to create at least a skeleton Owner<br>&gt; object, if nothing else, before the real one is found on the network.<br>&gt; It seems to be a problem for short-term testing while in the real
<br>&gt; situation the PS would be initialized far before any particular activity<br>&gt; asks for the owner.<br><br>This should be fixed now; but all you really have access to immediately<br>is the owner's name until the first services provided by the owner (ie,
<br>the chat and presence ones) are resolved.&nbsp;&nbsp;Eventually you'll likely have<br>access to the owner's color and such before service resolution too.&nbsp;&nbsp;So<br>you shouldn't need to import and/or init sugar.env.<br><br>Dan<br>
<br>&gt; Dan<br>&gt;<br>&gt; &gt; An alternative way to get the nick name is to use sugar.env.get_nick_name()<br>&gt; &gt;<br>&gt; &gt; Marco<br>&gt;<br>&gt; _______________________________________________<br>&gt; Sugar mailing list
<br>&gt; <a href="mailto:Sugar@laptop.org">Sugar@laptop.org</a><br>&gt; <a href="http://mailman.laptop.org/mailman/listinfo/sugar">http://mailman.laptop.org/mailman/listinfo/sugar</a><br><br>_______________________________________________
<br>Sugar mailing list<br><a href="mailto:Sugar@laptop.org">Sugar@laptop.org</a><br><a href="http://mailman.laptop.org/mailman/listinfo/sugar">http://mailman.laptop.org/mailman/listinfo/sugar</a><br></blockquote></div><br>