[sugar] Python: distutils, setuptools, packages, etc

Marco Pesenti Gritti mpg
Thu Sep 28 14:03:19 EDT 2006


>> Whew, those instructions are tricky. 
>>     
>
> I've done a little editing on the instructions a bit, and I agree that
> they are still tricky.  I'm also totally new to auto* tools which is why
> I added the explanatory text.  Please help make it better by making your
> own changes to the wiki.
>
>   

I imagine they might be hard to understand if you didn't use auto* 
before. I tend to blame it on auto* rather than on the instructions 
though, and that's why I'm interested to experiment with alternatives.

>>  My impression is that you create a 
>> source layout like:
>>
>>    MyCode/
>>      mycode/__init__.py
>>      mycode/mycode.activity
>>      mycode/the_actual_code.py
>>
>> And I guess ultimately "sugar-setup-activity mycode/mycode.activity" is 
>> called?
>>     
>
> No, you call it like sugar-activity org.laptop.sugar.PenguinTV where the
> org.laptop string is the id from the .activity file.  I had a lot of
> trouble getting this part right.
>
>
>   

There are two different things here.

sugar-activity blahblah can be used to run an activity from inside the 
sugar shell.

sugar-setup-activity is currently just taking care of setting up the 
activity with dbus so that dbus knows how to activate it. We still need 
to figure out exactly how this will work with bundles.

>   
>> But, um, the activity.  I'm actually vague about what happens *to* the 
>> activity.  Also, I believe there are some security things to figure out 
>> about installation.  So this is rather anticlimactic, since I can't 
>> complete the setuptools/activity story...
>>     
>
> The activity.py file has one job -- add the main widget of your program
> to "self".    In most cases, this means it will simply instantiate your
> program and self.add a widget from that program into the activity.
>
> In other words, when your activity is loaded you're given a blank
> widget, and it's your responsibility to put something into that widget.
> Instead of a Window, you're working in a widget.
>   

Note that you are actually packing the widget inside a GtkWindow. The 
window doesn't have chromes because that's how we setup matchbox to 
manage it.

Marco


More information about the Sugar-devel mailing list