Help with activity bundles

Talk about how to use and get the most out of Activities for the XO.

Help with activity bundles

Postby xodev » Fri Mar 19, 2010 10:05 am

Hello there:

I'm new on the forum and programming on python and making activities for the XO laptop. When I studied how to make an activity on this link: http://wiki.laptop.org/go/Activity_tutorial

Trying to bundle the activity I got the following error:

p:~$ python ./HelloWorldActivity.activity/setup.py
Traceback (most recent call last):
File "./HelloWorldActivity.activity/setup.py", line 3, in <module>
bundlebuilder.start()
File "/usr/lib/pymodules/python2.6/sugar/activity/bundlebuilder.py", line 415, in start
config = Config()
File "/usr/lib/pymodules/python2.6/sugar/activity/bundlebuilder.py", line 80, in __init__
self.update()
File "/usr/lib/pymodules/python2.6/sugar/activity/bundlebuilder.py", line 83, in update
self.bundle = bundle = ActivityBundle(self.source_dir)
File "/usr/lib/pymodules/python2.6/sugar/bundle/activitybundle.py", line 65, in __init__
raise MalformedBundleException('No activity.info file')
sugar.bundle.bundle.MalformedBundleException: No activity.info file

And my activity.info file have the following text:

[Activity]
name = HelloWorld
bundle_id = org.laptop.HelloWorldActivity
exec = HelloWorldActivity.HelloWorldActivity
icon = activity-helloworld
activity_version = 1
host_version = 1
show_launcher = yes

I'm using Ubuntu 9.1 with the Sugar Emulator inside and I don't know what I must do bundling this activity. Anybody can help me please?
xodev
 
Posts: 2
Joined: Fri Mar 19, 2010 9:56 am

Re: Help with activity bundles

Postby ektoric » Fri Mar 19, 2010 11:21 am

Make sure your activity.info file is in the right place. Per the URL you provided:
Write the activity.info file, to describe your bundle in the activity sub-directory (e.g. HelloWorldActivity.activity/activity/activity.info).


Make sure you are running the setup.py from the right directory. You may need to be in the "HelloWorldActivity.activity" directory. From where you are, try:
Code: Select all
cd HelloWorldActivity.activity
python setup.py
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: Help with activity bundles

Postby xodev » Sun Mar 21, 2010 3:29 pm

Yes you're right. Now I can run the HelloWorld activity normally. But I did it after to download the .xo file and change it to .zip to bundle it again on the OLPC because I got an error with the files I had at the begining on the activity tutorial website, It's different than the code provided on the HelloWorld-1.xo file on the same link.

Thanks :)

I have two questions. That's why as I said before the codes on the activity tutorial link and the HelloWorld1.xo are different:

1) what about the bundle_id attribute on the activity.info file? what I must write there when I'm developing a new activity for the XO ?

2) The MANIFEST file must have a list of all the files inside the activity main folder or just the main .py file (when I found the real source of the activity)?

Help pelase with that questions
xodev
 
Posts: 2
Joined: Fri Mar 19, 2010 9:56 am

Re: Help with activity bundles

Postby ektoric » Mon Mar 22, 2010 3:11 am

xodev wrote:1) what about the bundle_id attribute on the activity.info file? what I must write there when I'm developing a new activity for the XO ?


Per the URL you provided:
The Activity Bundles specification explain in detail the meaning of each field.

which further describes the "bundle_id" activity bundle identifier.

xodev wrote:2) The MANIFEST file must have a list of all the files inside the activity main folder or just the main .py file (when I found the real source of the activity)?


Per the URL you provided:
Create a MANIFEST (e.g. HelloWorldActivity.activity/MANIFEST), containing the list of the files (relative to the directory that the MANIFEST is in) to include in the package.

Which clearly states that it needs the full list of files, and not just the one main .py file.

It's been a loooong time since I played with packaging an activity (when the G1G1 first came out). I'm happy to see that the wiki page is filling out nicely, since it was indeed able to answer all your questions!
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX


Return to Activities / Software

Who is online

Users browsing this forum: No registered users and 1 guest