[sugar] AttributeErrors

Erik Blankinship erikb
Tue Sep 5 18:05:30 EDT 2006


Below is a simple sugar app and the log it creates when run on today's
build.

There appears to be a problem with:
[1] AttributeError: 'crop' object has no attribute '_activity_type'
and
[2] AttributeError: 'NoneType' object has no attribute 'get_name'

If I remove the Presence calls (just the gtk button), I don't get these
errors.  Any ideas?  Thanks.


import gtk

from sugar.activity.Activity import Activity
from sugar.presence import PresenceService
import logging

class crop(Activity):
    def __init__(self):
        Activity.__init__(self)

        button = gtk.Button('Why am I busted?')
        self.add(button)
        button.show()

        self._ps = PresenceService.get_instance()
        me = self._ps.get_owner()
        name = me.get_name()
        logging.info("I am %s" % name)
        activities = self._ps.get_activities()
        for act in activities:
            logging.info("Activity: %s" % act.get_id())


# # #

Traceback (most recent call last):
  File
"/root/sugars/09-05/sugar-jhbuild/build/share/sugar/shell/frame/BottomPanel.py",
line 53, in __activity_clicked_cb
    self._shell.start_activity(icon.get_bundle_id())
  File "/root/sugars/09-05/sugar-jhbuild/build/share/sugar/shell/Shell.py",
line 163, in start_activity
    activity = ActivityFactory.create(activity_type)
  File
"/root/sugars/09-05/sugar-jhbuild/build/lib/python2.4/site-packages/sugar/activity/ActivityFactory.py",
line 56, in create
    xid = factory.create()
  File "/usr/lib/python2.4/site-packages/dbus/proxies.py", line 25, in
__call__
    ret = self._proxy_method (*args, **keywords)
  File "/usr/lib/python2.4/site-packages/dbus/proxies.py", line 102, in
__call__
    reply_message = self._connection.send_with_reply_and_block(message,
timeout)
  File "dbus_bindings.pyx", line 455, in
dbus_bindings.Connection.send_with_reply_and_block
DBusException: Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/dbus/service.py", line 304, in
_message_cb
    retval = candidate_method(self, *args, **keywords)
  File
"/root/sugars/09-05/sugar-jhbuild/build/lib/python2.4/site-packages/sugar/activity/ActivityFactory.py",
line 42, in create
    activity = self._class()
  File
"/root/sugars/09-05/sugar-jhbuild/build/share/sugar/activities/crop/crop.py",
line 19, in __init__
    name = me.get_name()
AttributeError: 'NoneType' object has no attribute 'get_name'

Traceback (most recent call last):
  File "/root/sugars/09-05/sugar-jhbuild/build/share/sugar/shell/Shell.py",
line 107, in __window_opened_cb
    host = ActivityHost(self, window)
  File
"/root/sugars/09-05/sugar-jhbuild/build/share/sugar/shell/ActivityHost.py",
line 24, in __init__
    self._type = self._activity.get_type()
  File "/usr/lib/python2.4/site-packages/dbus/proxies.py", line 102, in
__call__
    reply_message = self._connection.send_with_reply_and_block(message,
timeout)
  File "dbus_bindings.pyx", line 455, in
dbus_bindings.Connection.send_with_reply_and_block
DBusException: Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/dbus/service.py", line 304, in
_message_cb
    retval = candidate_method(self, *args, **keywords)
  File
"/root/sugars/09-05/sugar-jhbuild/build/lib/python2.4/site-packages/sugar/activity/Activity.py",
line 52, in get_type
    return self._activity.get_type()
  File
"/root/sugars/09-05/sugar-jhbuild/build/lib/python2.4/site-packages/sugar/activity/Activity.py",
line 97, in get_type
    return self._activity_type
AttributeError: 'crop' object has no attribute '_activity_type'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.laptop.org/pipermail/sugar/attachments/20060905/04be073d/attachment-0001.html


More information about the Sugar-devel mailing list