[OLPC-Games] Help with porting pygame code to sugar

Tim Wintle tim.wintle at teamrubber.com
Sat Dec 15 11:44:14 EST 2007


oops, sent tis from the wrong email address and I don't think it got to
the group ...

* I'll mention I'm new to the OLPC and although I've used Fedora since
version 2 (first Linux was Red Hat 5) I generally use debian, and get
the sys-admin to do the system-level stuff at work*

- i.e. I'm prepared to discover I've just done something stupid.


I'm not running sugar-jhbuild, Just running a straight disk image under
qemu.

I should have clarified, I was using the buildskel script to generate my
base class (as on the wiki).

I ran buildskel *on Ubuntu* (if that's a problem) and then scp'd the
entire test.activity directory across to my emulator (including the
linked OLPCGames folder).
I didn't initially run buildmanifest, but I have run it since. I also
ran ./setup.py dev

When I couldn't get my own code to run I tried running the plain
blue-screen generated by buildskel. It runs fine on Ubuntu and if I run
the "run.py" script from python on the emulator (without any tie-ins to
the system like the menu or listing it on the home screen), but not when
it's launched from sugar.

I had a look and do have sugar-activities, so it's not been scrapped. I
also don't have sugar-launch, so I guess that is still in the planning
phase (or not in the devel image yet).

I'm just a bit stuck :(



On Sat, 2007-12-15 at 09:19 -0500, Mike C. Fletcher wrote:
> Tim Wintle wrote:
> > Hi,
> >
> > I've been trying to use the OLPCGames scripts to create a sugar
runtime,
> > but I can't get it to work on my emulated laptop.
> > (Running qemu on Ubuntu Gutsy 64 - everything else seems to work
great.)
> >
> > I get all the scripts fine, and everything works in (my) Linux.
> >   
> I'm assuming by this you mean in a sugar-jhbuild environment on your
> Linux machine.
> > I then scp them to the XO (I've tried direct
to /usr/share/activities
> > and to ~/olpc - it's not clear from the wiki where to put them)
> >   
> ~olpc/Activities is the correct directory for activities not included
in
> the core image.
> > Running "setup.py dev" seems to work fine, and after reboot the
activity
> > appears in the frame.
> >
> > But... I can't launch the activity.
> >
> > Looking in the logs I find a DBus error
> > "org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute
> >
program /home/olpc/Activities/test.activity.activity/sugar-activity:No
> > such file or directory"
> >
> > - what I don't understand is why is this .activity.activity? surely
it's
> > meant to be .activity?
> >   
> Yes, it is.  There is something wrong with the sugar bundle-builder
> code.  It just blindly appends ".activity" to whatever the directory
> name is where it is being run and creates a symlink in ~/Activities to
> that name.  You can temporary work around it by doing the following:
> 
>   cd ~/Activities
>   wget http://dev.laptop.org/~mcfletch/testactivities/videotest-1.xo
>   unzip videotest-1.xo
> 
> then restart the X server (ctrl+alt+erase on a real XO, or restart the
> emulator).  You can re-download and re-unzip over the current image
> (remember to delete the original .xo if you are using wget).
> 
> The thing is, even though it's ugly as dirt, that *shouldn't* be your
> problem.  That is, I have lots of ugly .activity.activity directories
in
> my Activities folder and everything still runs.
> > - is sugar-activity a standard command to launch an activity in the
> > active directory? (There's no file of that name so I guess so)
> >   
> Apparently they've now declared sugar-activity an internal api,
> sugar-launch is the way to launch an activity *externally* these days,
> but yes, sugar-activity should be there AFAIK, for precisely this
> purpose.  It's not an incorrectly-specified module name, that gives
'No
> module named blah'.  Neither is it a problem with leaving off the
> argument 'A python class must be specified as first argument'.
> 
> So, maybe sugar-activity really has disappeared on your "machine"?  It
> should be pretty easy to test this, look for /usr/bin/sugar-activity
if
> it's not there, then we'll need to pester the Sugar devs about why it
> isn't and what to do with the dozens of projects using it.
> > Hope someone can give some advice on how to sort this out, thanks in
> > advance.
> >   
> Hopefully that helps somewhat.
> > BTW, I am working on a project called Game Baker
> > (http://code.google.com/p/game-baker/)
> >
> > which we hope to make into a completely graphical game development
> > environment (currently pre-alpha, still requires simple python for
event
> > handlers, and it will be a while before we port the GUI to sugar -
but
> > it's a major goal).
> >
> > I'm trying to make an exporter to sugar packages, so games made with
the
> > system can run on the XO - hoping this will enable people who want
to
> > help but can't program to create educational games for the OLPC.
> >   
> That's great.  You may want to check out the olpcgames/skeleton
> directory, which builds Sugar-ready OLPCGames activities from the
> command-line (available in git or in the 1.3 release).  I would like
to
> move some of the code there (such as the build manifest script) into
> OLPCGames proper so that there's less in the "boilerplate" stuff that
> you check into your repository.
> 
> HTH,
> Mike
> 




More information about the Games mailing list