[Sugar-devel] about about my xo

Erik Blankinship erikb at mediamods.com
Fri Mar 4 13:46:28 EST 2011


Hi Chris!

I tried:

* Looking at an up-to-date activity for best practices.  In this case I
looked at TurtleArt 106 and saw this code:

from sugar.activity import activity
try:  # 0.86 toolbar widgets
    from sugar.activity.widgets import ActivityToolbarButton, StopButton
    from sugar.graphics.toolbarbox import ToolbarBox, ToolbarButton
    NEW_SUGAR_SYSTEM = True
except ImportError:
    NEW_SUGAR_SYSTEM = False

Alas, this did not provide the granularity I was hoping to find.  I can
however appreciate why this type of check might have been written to ensure
backwards compatibility.
* I looked in the book "Make Your Own Sugar Activities!" and the sugar
almanac but did not find the answer.
* Since I am not a system developer, I wrote to these lists to ask how an
activity developer should properly query this information.  When I find
myself breaking an abstraction barrier from activity into system I often
feel I have overlooked something or am building something fragile.  Thank
you for your answer.

It might be a good idea for the sugar api to make this type of information
readily available to developers in future releases.


On Thu, Mar 3, 2011 at 11:02 PM, Chris Ball <cjb at laptop.org> wrote:

> Hi,
>
> On Thu, Mar 03 2011, Erik Blankinship wrote:
> > Is there a way for a sugar activity (and gnome) to query the version and
> > build information which is displayed in "about my xo" in the sugar
> control
> > panel?
>
> The way I'd answer this is by:
>
> * finding out where the "about my xo" code lives
> * seeing if it exports this data to activities
> * if not, seeing if activities can get at it themselves
>
> And:
>
> * The code lives at sugar/extensions/cpsection/aboutcomputer/model.py
> * It does not obviously export data to activities
> * But it functions by reading files from the filesystem, and it looks
>  like an activity could read the same ones.
>
> - Chris.
> --
> Chris Ball   <cjb at laptop.org>   <http://printf.net/>
> One Laptop Per Child
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110304/7fd437d3/attachment.html>


More information about the Sugar-devel mailing list