<div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Hi Chris!</div><div><br></div><div>I tried:</div><div><br></div><div>* Looking at an up-to-date activity for best practices.  In this case I looked at TurtleArt 106 and saw this code:</div>
<div><br></div><div><div>from sugar.activity import activity</div><div>try:  # 0.86 toolbar widgets</div><div>    from sugar.activity.widgets import ActivityToolbarButton, StopButton</div><div>    from sugar.graphics.toolbarbox import ToolbarBox, ToolbarButton</div>
<div>    NEW_SUGAR_SYSTEM = True</div><div>except ImportError:</div><div>    NEW_SUGAR_SYSTEM = False</div><div><br></div><div>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.</div>
<div>* I looked in the book "<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Make Your Own <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 204); color: rgb(34, 34, 34); ">Sugar</span> Activities!</span>" and the sugar almanac but did not find the answer.</div>
<div>* 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.</div>
<div><br></div><div>It might be a good idea for the sugar api to make this type of information readily available to developers in future releases.</div><div><br></div><br><div class="gmail_quote">On Thu, Mar 3, 2011 at 11:02 PM, Chris Ball <span dir="ltr"><<a href="mailto:cjb@laptop.org" target="_blank">cjb@laptop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
Hi,<br><div><div></div><div><br>On Thu, Mar 03 2011, Erik Blankinship wrote:<br>> Is there a way for a sugar activity (and gnome) to query the version and<br>> build information which is displayed in "about my xo" in the sugar control<br>
> panel?<br><br></div></div>The way I'd answer this is by:<br><br>* finding out where the "about my xo" code lives<br>* seeing if it exports this data to activities<br>* if not, seeing if activities can get at it themselves<br>
<br>And:<br><br>* The code lives at sugar/extensions/cpsection/aboutcomputer/model.py<br>* It does not obviously export data to activities<br>* But it functions by reading files from the filesystem, and it looks<br> like an activity could read the same ones.<br>
<br>- Chris.<br><font color="#888888">--<br>Chris Ball   <<a href="mailto:cjb@laptop.org" target="_blank">cjb@laptop.org</a>>   <<a href="http://printf.net/" target="_blank">http://printf.net/</a>><br>One Laptop Per Child<br>
</font></blockquote><div><font color="#888888"><br></font></div></div></div></div>