[Sugar-devel] Question about Sugarizing a Python program

Nguyen, Lam nguyenla at dickinson.edu
Wed Mar 8 11:17:43 EST 2017


Thank you for the responses. James Simmon's book looks especially interesting. We will look into the approaches suggested. Meanwhile, we welcome any further suggestion that could help us with this process.


Best regards,

Lam Nguyen

________________________________
From: Sugar-devel <sugar-devel-bounces at lists.sugarlabs.org> on behalf of Tony Anderson <tony_anderson at usa.net>
Sent: Tuesday, March 7, 2017 19:20
To: sugar-devel at lists.sugarlabs.org
Subject: Re: [Sugar-devel] Question about Sugarizing a Python program

I have good luck with two methods. One is to download helloworld-6.xo.
It is actually a zip file and so can be unzipped.

The pertinent information is given in the activity.info file. Change all
references to HelloWorld to your name for the activity.

A Sugar activity wants an svg icon to show on the Home view. So
substitute your icon for the one in the activity folder.

The program is in directory activity.py as a python class. Change the
class name to match the exec line in activity.info.

Usually what I do is make a bundle with python setup.py dist_xo (reset
version in activity.info to 1 first). This bundle can be installed by
sugar-install-bundle hello-6.xo (substitute name of your bundle - e.g.
spell-1.xo).

Now launching the activity should show hello world to show that your
changes have created a working activity.

Now all that should be needed is to modify the activity to invoke your
code. Note that you need much of the existing code to set up the Sugar
toolbar. So I generally modify the code at the point that it provides a
Gtk.Label('Hello World').

The other approach is to use pippy.py. Copy and paste your code into the
text area. Now execute the code with pippy run to verify that it is
working there.
Then you can export as a bundle (activity toolbar).

I fully endorse Sebastian's recommendation of James Simmons text. This
will help with any problems you may encounter.

Tony

On 03/08/2017 04:53 AM, Sebastian Silva wrote:
>
> On 07/03/17 15:47, Sebastian Silva wrote:
>> Also, don't miss the excellent "Make Your Own Sugar Activities" by
>> James Simmons:
>>
>> http://write.flossmanuals.net/make-your-own-sugar-activities/introduction/
>>
> specifically the chapter:
>
> http://write.flossmanuals.net/make-your-own-sugar-activities/making-activities-using-pygame/
> _______________________________________________
> 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
Sugar-devel Info Page<http://lists.sugarlabs.org/listinfo/sugar-devel>
lists.sugarlabs.org
Sugar-devel -- Discussion of Sugar development and other technical matters. About Sugar-devel



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20170308/4d6ec087/attachment.html>


More information about the Sugar-devel mailing list