[Sugar-devel] Fwd: Problem developing app

James Simmons nicestep at gmail.com
Tue Dec 7 10:40:28 EST 2010


I meant to copy my answer to Rodrigo to the list:

---------- Forwarded message ----------
From: James Simmons <nicestep at gmail.com>
Date: Tue, Dec 7, 2010 at 9:39 AM
Subject: Re: [Sugar-devel] Problem developing app
To: Rodrigo <rodripf at gmail.com>


Rodrigo,

I've looked at your code and I see a couple of things that are
questionable.  First, your activity.info looks like this:

[Activity]
name = hMouse
service_name = org.teleton.ingenieria.hMouse
class = hMouse.hMouse
icon = activity-hMouse
activity_version = 1
license = GPLv3+
show_launcher = yes

Instead of class = you might try this:

exec = sugar-activity hMouse.hMouse

Second, you have these statements:

sys.path.insert(0, "lib/")
sys.path.insert(0, "/home/olpc/Activities/hMouse.activity/")
sys.path.insert(0, "/home/olpc/Activities/hMouse.activity/lib/")

These should not be necessary.  Everything in your Activity should be
either part of the normal Python path or contained in the XO bundle.
You're also hard coding paths that may not always exist.  If I test
your Activity using sugar-emulator, for instance, I won't have those
directories.

Another questionable thing is this in Procesador.py:

img = pygame.image.load("/home/olpc/Activities/hMouse.activity/help/camara.png")

The path to the image should be relative to the XO bundle location,
not an absolute path.  Check out my "Demoiselle" activity here:

http://git.sugarlabs.org/myo-sugar-activities-examples/mainline/trees/master/Making_Activities_Using_PyGame

It looks like your Activity interacts with the hardware in unusual
ways.  This may not be allowed by Rainbow, which is a kind of sandbox
used by Sugar.

James Simmons


On Tue, Dec 7, 2010 at 6:37 AM, Rodrigo <rodripf at gmail.com> wrote:
> I've made it! It is published under the GPL v.3.0 and accessible from git
> in:
> http://git.sugarlabs.org/hmouse
>
> The problem still the same, I can't launch it from the activities ring, only
> from terminal with sugar-launch command.
> There is an explanation of what the program is in the folder /src/doc/es.
> There is only in Spanish for now, I will be translating it to English soon.
>
> I really appreciate your help. Obviously you are invited to make any other
> suggest or code change to improve the development.
> --
> Rodrigo Pérez Fulloni
>
>
> On Wed, Dec 1, 2010 at 1:13 PM, Gabriel Eirea <geirea at gmail.com> wrote:
>>
>> Rodrigo:
>>
>> Si esta aplicación tiene una licencia libre entonces deberías poner el
>> código en git para que otros puedan ayudarte. Deberías discutir esto
>> con tus jefes. En ceibalJAM! podemos ayudarte, venimos desarrollando
>> aplicaciones para Sugar desde hace bastante tiempo (ceibaljam.org).
>>
>> Saludos,
>>
>> Gabriel
>>
>> 2010/12/1 Rodrigo <rodripf at gmail.com>:
>> >> Is your source code uploaded to a git repository?
>> >
>> > No yet, the company I'm working for doesn't let me upload it until it's
>> > finished :'(
>> >>
>> >> I'd suggest bringing up the Log Activit
>> >
>> >  I've done what you said, and seems to make more sense, but I can't get
>> > the
>> > meaning anyway. I attach the log from the Log Activity.
>> > What do you say?
>> > Thank you
>> > --
>> > Rodrigo Pérez Fulloni
>> >
>> >
>> > _______________________________________________
>> > Sugar-devel mailing list
>> > Sugar-devel at lists.sugarlabs.org
>> > http://lists.sugarlabs.org/listinfo/sugar-devel
>> >
>> >
>
>
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>


More information about the Sugar-devel mailing list