Line 1: |
Line 1: |
− | <noinclude>{{GoogleTrans-en}}{{TeamHeader|Activity Team}}</noinclude>{{TOCright}} | + | <noinclude>{{TeamHeader|Activity Team}}</noinclude> |
| | | |
| ==Getting started in Activity development== | | ==Getting started in Activity development== |
| If you have no experience developing Sugar activities, these resources will help get you started. | | If you have no experience developing Sugar activities, these resources will help get you started. |
| + | |
| + | === Activity development tutorials === |
| + | {| |
| + | |- |
| + | |<span class="plainlinks">[[File:Sugarlabs_mainpage_07.png|link=http://en.flossmanuals.net/make-your-own-sugar-activities]]</span> |
| + | |valign="center"|The official introduction to writing Sugar activities is the Flossmanuals book [http://en.flossmanuals.net/make-your-own-sugar-activities/ Make Your Own Sugar Activities!] by James Simmons. |
| + | |} |
| | | |
| ====Setting up a Sugar environment==== | | ====Setting up a Sugar environment==== |
− | If you use Linux, your best bet is to install [[Development Team/Jhbuild|sugar-jhbuild]]. You will be able to develop in your native environment, treating Sugar as just another desktop application.
| |
| | | |
− | If you run MacOS X or Windows, you will need to set up an emulator. For setup instructions and links to pre-configured virtual machines, see [[VirtualBox]].
| + | Please see [[Downloads | Get Sugar]] for details on how to best get Sugar running. |
| | | |
− | To develop efficiently using an emulator or a secondary machine (such as an OLPC XO), find an editor which supports editing files over a SFTP connection. [http://www.openkomodo.com/ Komodo Edit] with the Remote Drive Tree extension is a good example.
| + | If you decide to use a Virtual Machine (VM) or a secondary machine (such as an OLPC XO) for testing your activities, an editor with support for editing files over an SSH or SFTP connection can come in handy. [http://www.activestate.com/komodo-edit/downloads Komodo Edit] with the Remote Drive Tree extension, emacs with tramp and magit, and [http://www.eclipse.org Eclipse] with the [http://www.jcraft.com/eclipse-sftp/ SFTP Plugin] are examples. |
| | | |
| ====Python Reference & Tutorials==== | | ====Python Reference & Tutorials==== |
| + | * [http://greenteapress.com/thinkpython/thinkpython.html Think Python: How to Think Like a Computer Scientist] |
| * http://docs.python.org/ | | * http://docs.python.org/ |
| * http://diveintopython.org/ | | * http://diveintopython.org/ |
| * [http://pleac.sourceforge.net/pleac_python/index.html PLEAC - Programming Language Examples Alike Cookbook] | | * [http://pleac.sourceforge.net/pleac_python/index.html PLEAC - Programming Language Examples Alike Cookbook] |
− | | + | * http://code.google.com/edu/languages/google-python-class/ |
| + | * [http://people.csail.mit.edu/pgbovine/python/ Online Python Tutor] - Online stepping & visualization of Python code |
| + | * [http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/ 6.00SC Introduction to Computer Science and Programming] |
| + | *http://www.babarehner.com/ewrench1011/Python/index.html |
| Python is the language Sugar is written in and is also used by most activities. If you don't already know Python well, you should familiarize yourself with it before continuing. | | Python is the language Sugar is written in and is also used by most activities. If you don't already know Python well, you should familiarize yourself with it before continuing. |
| | | |
Line 28: |
Line 38: |
| The following sections of the PyGTK tutorial are most relevant to activity development. | | The following sections of the PyGTK tutorial are most relevant to activity development. |
| | | |
− | * 1. Introduction
| + | : 1. Introduction |
− | * 2. Getting Started
| + | : 2. Getting Started |
− | * 3. Moving On
| + | : 3. Moving On |
− | * 4. Packing Widgets
| + | : 4. Packing Widgets |
− | * 5. Widget Overview
| + | : 5. Widget Overview |
− | * 6. The Button Widget
| + | : 6. The Button Widget |
− | * 7. Adjustments
| + | : 7. Adjustments |
− | * 8. Range Widgets
| + | : 8. Range Widgets |
− | * 9. Miscellaneous Widgets
| + | : 9. Miscellaneous Widgets |
− | * 10. Container Widgets
| + | : 10. Container Widgets |
− | * 12. Drawing Area
| + | : 12. Drawing Area |
| + | |
| + | Also see: |
| + | |
| + | * http://www.majorsilence.com/PyGTK_Book |
| | | |
| ====Sugar Activities==== | | ====Sugar Activities==== |
Line 45: |
Line 59: |
| The Sugar Almanac contains all the information you need to start writing Sugar activities, ranging from directory structure to bundle format to API reference. It also contains answers to common questions and examples of common tasks. | | The Sugar Almanac contains all the information you need to start writing Sugar activities, ranging from directory structure to bundle format to API reference. It also contains answers to common questions and examples of common tasks. |
| | | |
− | * http://api.sugarlabs.org/ | + | * https://developer.sugarlabs.org/sugar3 |
| | | |
| This automatically updated site contains the official API documentation for Sugar. Though it is currently quite sparse, the source code is included with the documentation and it's useful to have that at your fingertips. | | This automatically updated site contains the official API documentation for Sugar. Though it is currently quite sparse, the source code is included with the documentation and it's useful to have that at your fingertips. |
Line 86: |
Line 100: |
| | | |
| ====Git introduction==== | | ====Git introduction==== |
− | Git is the version control software used by Sugar Labs. It is a distributed version control system and is quite powerful, but requires a lot of command line use. | + | Git is the version control software used by Sugar Labs. It is a distributed version control system and is quite powerful, but may require a lot of command line use. |
| | | |
| * [[Activity Team/Git|Git]] | | * [[Activity Team/Git|Git]] |
| + | * [https://github.com/ GitHub] |
| | | |
| ====XML routines==== | | ====XML routines==== |
Line 96: |
Line 111: |
| | | |
| ====Speech synthesizing==== | | ====Speech synthesizing==== |
− | If you want to add a speech synthesizer for English and other languages, try the [[Activity_Team/gst-plugins-espeak|gst-plugins-espeak]] plugin for gstreamer. | + | If you want to add a speech synthesizer for English and other languages, use the sugar3.speech module, or try the [[Activity_Team/gst-plugins-espeak|gst-plugins-espeak]] plugin for gstreamer. |
| | | |
| ==Activity Development Resources== | | ==Activity Development Resources== |
| This is an open area for posting links related to activity development. | | This is an open area for posting links related to activity development. |
| + | ===Hosting=== |
| + | https://github.com/sugarlabs may host your Sugar related code. |
| | | |
| ===Sample code=== | | ===Sample code=== |
Line 106: |
Line 123: |
| * An example of [[Activity Team/Sample code/Ruler|a simple activity that uses Cairo graphics]] | | * An example of [[Activity Team/Sample code/Ruler|a simple activity that uses Cairo graphics]] |
| * An [http://uclug.org/images/Sugar.odp OpenOffice presentation] that touches on many of the issues encountered by first-time Sugar developers. Some items covered are: What is Sugar and Sugar Labs; What are some development environments; Some Sugar specific python statements for a PyGTK activity; Activity distribution. You can also [http://media.libsyn.com/media/dsyates/101309uclug0020.ogg listen] to the creator ([http://wiki.sugarlabs.org/go/User:Ossfm ossfm]) give the presentation at a LUG meeting (starting at 9 minutes and 55 seconds). | | * An [http://uclug.org/images/Sugar.odp OpenOffice presentation] that touches on many of the issues encountered by first-time Sugar developers. Some items covered are: What is Sugar and Sugar Labs; What are some development environments; Some Sugar specific python statements for a PyGTK activity; Activity distribution. You can also [http://media.libsyn.com/media/dsyates/101309uclug0020.ogg listen] to the creator ([http://wiki.sugarlabs.org/go/User:Ossfm ossfm]) give the presentation at a LUG meeting (starting at 9 minutes and 55 seconds). |
| + | |
| + | ===Profiling in Python=== |
| + | |
| + | import os |
| + | import cProfile |
| + | import lsprofcalltree |
| + | |
| + | profiler = cProfile.Profile() |
| + | profiler.enable() |
| + | |
| + | # code to profile goes here |
| + | |
| + | profiler.disable() |
| + | profiler.dump_stats('/tmp/profile') |
| + | |
| + | Use kcachegrind to view the results. |
| | | |
| ===References=== | | ===References=== |
Line 132: |
Line 165: |
| * [[Activity_Team/Modifing_an_Activity]] Information describing simple modifications that can be made to common Sugar activities. | | * [[Activity_Team/Modifing_an_Activity]] Information describing simple modifications that can be made to common Sugar activities. |
| * [[Activity Team/Compatibility Tips]] Information on ensuring your activity is portable to the various distributions that run Sugar. | | * [[Activity Team/Compatibility Tips]] Information on ensuring your activity is portable to the various distributions that run Sugar. |
| + | |
| + | ==== Old tutorials ==== |
| + | |
| + | * Porting a PyGTK game to Sugar, [http://www.redhatmagazine.com/2007/04/05/building-the-xo-porting-a-pygtk-game-to-sugar-part-one/ Part 1] and [http://www.redhatmagazine.com/2007/04/26/building-the-xo-porting-a-pygtk-game-to-sugar-part-two/ Part 2], Red Hat Magazine. |
| + | * [http://wiki.laptop.org/go/Beyond_Hello_World Beyond Hello World], wiki.laptop.org |
| | | |
| ===Community resources=== | | ===Community resources=== |
− | * http://dev.sugarlabs.org/ Bug tracking for Sugar and activities. Go here to report bugs in the Sugar toolkit. Each activity should have its own component here. | + | * http://bugs.sugarlabs.org/ Bug tracking for Sugar and activities. Go here to report bugs in the Sugar toolkit. Each activity should have its own component here. |
| * http://git.sugarlabs.org/ Gitorious source code hosting. | | * http://git.sugarlabs.org/ Gitorious source code hosting. |
| * http://git.sugarlabs.org/events.atom RSS feed of all Sugar development activity. Great for keeping an eye on the project as a whole. | | * http://git.sugarlabs.org/events.atom RSS feed of all Sugar development activity. Great for keeping an eye on the project as a whole. |