MarketingTeam/TODO/What's New for Developers/Sugar 0.84

From Sugar Labs
Jump to navigation Jump to search

Sugar 0.84: What's new for developers

The new version of Sugar has made a lot of progress in our goal of encouraging users to appropriate the technology. We don't want our users to be just consumers, we would like them to feel empowered to learn how things are done. That's why we have been working towards making it as easy as possible to modify Sugar itself to better suit their personal and collective needs.

There are two aspects in Sugar that remove the limits from what can be done with it: It's written in Python, and it's distributed as <a href="http://en.wikipedia.org/wiki/Free_software">Free Software</a>. Python is an interpreted programming language that is very easy to understand and modify. Being Free Software, means that users have full rights to use, modify, and redistribute it.

We operate under the belief that the separations between code and content and between consumer and producer are obstacles inherent in the now traditional software and media industries. Our work has focused on three features of Sugar that lower the barriers for people who wish to modify Sugar. We call the removing of limits on possibilities, *raising the ceiling*, and the lowering or easing of entry ramps, *lowering the floor* for computing success.

View source

In earlier releases, only Etoys, and some simple activities like Chat and Read, had any built-in ability for displaying their source code. For Sugar 0.84, we have extended this capability to all activities, so users can drill deeper into how things are done. This feature works better for activities that are written in an interpreted language like Python, but if a compiled activity also ships its source code, users will be able to read it as well. Since Sugar users are growing smarter and smarter every day, they soon understand how it all works and will make even better versions for us all.

<screenshot>

The authors of activities like Browse and TurtleArt might want to give special code drilling capabilities to these activities, so their users can see how programs in TurtleArt would look in Logo, or curious readers can peek into the HTML code of a web page.

The author of an activity written in Python that wishes to handle all the source viewing by herself can override the <a href="http://api.sugarlabs.org/sugar.activity.activity.Activity-class.html">Activity.handle_view_source</a> method. This will replace the standard dialog that would be displayed by the default implementation. And if one intends only to provide an additional source file to the default dialog, then <a>Activity.get_document_path</a> can be overridden.

Authors of activities written in languages other than Python can implement the methods org.laptop.Activity.HandleViewSource() and org.laptop.Activity.GetDocumentPath(), as kindly documented by Bert Freudenberg <a href="http://wiki.laptop.org/go/Low-level_Activity_API#D-Bus_Methods">here</a>.

Extending the Sugar shell

Extending the shell was never that easy. For example, you can extend the Control Panel by adding a new section, add a new device to the Frame, or define a keyboard shortcut. You only need to place your Python code, following the API guidelines, at the right place, and the extension will be picked up by the shell on startup, automatically. The API is unstable for the present moment, and will be reviewed in the next release cycle. Nevertheless, people have been writing little widgets, like a clock, for the Frame already. Have a look at <a>@@@@@@@</a> on how to do so.

Using Etoys, Mozilla, Abiword, and Evince in your activity

The <a href="http://wiki.sugarlabs.org/go/DevelopmentTeam/SugarPlatform/0.84">Sugar platform</a> provides several sets of tools that can be used as building blocks.

One is Etoys, an advanced interactive development environment in the Smalltalk lineage. With it comes the Squeak virtual machine, which will run your activities not only on Sugar, but on Squeak versions available for almost any computer.

Embedding Mozilla into your activity will give it browser abilities, like rendering html and executing javascript. For Python activities, run 'pydoc hulahop' or check out the <a href="http://git.sugarlabs.org/projects/browse">Browse sources</a>. You can watch for even better integration with the web in Sugar 0.86.

Abiword offers a powerful text processing widget with advanced features like those found in word processors. It also offers collaboration that allows several users of your activity to edit a text buffer simultaneously across the network. You can base your work on <a href="http://git.sugarlabs.org/projects/write">Write's source code</a> or run 'pydoc abiword'.

Evince is a document viewer that will render PDF, PostScript, and other document formats within an area of your activity's window. Python coders can check 'pydoc evince' or see <a href="http://git.sugarlabs.org/projects/read">Read's source code</a>.

Now, stop reading this static code, and get busy coding some live activities for all the children of the world! [please suggest a better final word]