Make Your Own Sugar Activities!

If you are going to write Sugar Activities you should learn something about the topics described in this chapter. There is no need to become an expert in any of.
Table of contents

Sugargame is a package which makes it possible to embed Pygame into a Sugar activity. Required reading before planning the user interface for your activity.


  • A Complaint Free World: The 21-day challenge that will change your life;
  • The Tempering of Men (Iskryne);
  • Activity Team/Resources - Sugar Labs;
  • What Is Version Control?.
  • Internationalizing Higher Education: Critical Explorations of Pedagogy and Policy: 16 (CERC Studies ;
  • Introduction;
  • What you need.

These pages give a good introduction to the thought process behind the Sugar environment and will help a lot when designing your activity. Once you have strings in your Activity, here are some general tips which will make your translators happy: Currently, the recommended JSON library is simplejson. There is an odd thing about simplejson - in python25 it lives in simplejson module, but in python26 it uses json module.

So, use something like this to wrap it. 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. It's supported out of the box in Python 2.

In previous versions you'll have to install library by yourself. If you want to add a speech synthesizer for English and other languages, use the sugar3. If you have a question, don't hesitate to ask the activity team. We are happy to help and can often save you a lot of hunting for answers. We hang out in sugar on irc. Retrieved from " https: Navigation menu Personal tools Log in. This is a good page for looking at code on the screen, but it doesn't print well and it's not much good for copying snippets of code into Eric windows either. For either of those things you'll want to click on raw blob data at the top of the listing:.

We're not done yet. Use the Back button to get back to the pretty print listing and click on the Commits link. This will give us a list of everything that changed each time we committed code into Git:. You may have noticed the odd combination of letters and numbers after the words James Simmons committed.

Your first HTML5 Activity

This is a kind of version number. The usual practice with version control systems is to give each version of code you check in a version number, usually a simple sequence number. Git is distributed, with many separate copies of the repository being modified independently and then merged.

Create Your Own Healthful Snack

That makes using just a sequential number to identify versions unworkable. Instead, Git gives each version a really, really large random number. The number is expressed in base 16, which uses the symbols and a-f. What you see in green is only a small part of the complete number.

The number is a link, and if you click on it you'll see this:.

Make your own sugar activities

At the top of the page we see the complete version number used for this commit. Below the gray box we see the full comment that was used to commit the changes. Below that is a listing of what files were changed. If we look further down the page we see this:. This is a diff report which shows the lines that have changed between this version and the previous version. For each change it shows a few lines before and after the change to give you a better idea of what the change does. Every change shows line numbers too. A report like this is a wonderful aid to programming.

Sometimes when you're working on an enhancement to your program something that had been working mysteriously stops working. When that happens you will wonder just what you changed that could have caused the problem.

Activity Team/Resources

A diff report can help you find the source of the problem. By now you must be convinced that you want your project code in Git. Before we can do that we need to create an account on this website. That is no more difficult than creating an account on any other website, but it will need an important piece of information from us that we don't have yet.

Getting that information is our next task. In other words, it uses a secret code so nobody but the person getting the data can read it. In simple terms it works like this: The first number, called the private key , is kept secret and is only used by you to encode the data. The second number, called the public key , is given to anyone who needs to decode your data. He can decode it using the public key; there is no need for him to know the private key. He can also use the public key to encode a message to send back to you and you can decode it using your private key.

Git uses SSH like an electronic signature to verify that code changes that are supposed to be coming from you actually are coming from you. The Git repository is given your public key. It knows that anything it decodes with that key must have been sent by you because only you have the private key needed to encode it. We will be using a tool called OpenSSH to generate the public and private keys.

This is included with every version of Linux so you just need to verify that it has been installed. Then use the ssh-keygen utility that comes with OpenSSH to generate the keys: By default ssh-keygen generates an RSA key, which is the kind we want. Just hit the Enter key to continue. Now we DO want a passphrase here.

A passphrase is like a password that is used with the public and private keys to do the encrypting. When you type it in you will not be able to see what you typed. Because of that it will ask you to type the same thing again, and it will check to see that you typed them in the same way both times. When choosing a passphrase remember that it needs to be something you can type reliably without seeing it and it would be better if it was not a word you can find in the dictionary, because those are easily broken.

When I need to make a password I use the tool at http: This tool generates a bunch of nonsense words that are pronounceable. Pick one that appeals to you and use that. Now have a look inside the. By convention every file or directory name that begins with a period is considered hidden by Linux, so it won't show up in a GNOME file browser window unless you use the option on the View menu to Show Hidden Files. When you display the contents of that directory you'll see two files: Try opening that file with gedit Open With Text Editor and you'll see something like this:.

When you create your account on git. To do that use Select All from the Edit menu in gedit, then Copy and Paste into the field provided on the web form. I'm going to create a new Project in Git for the examples for this book. I need to log in with my new account and click the New Project link we saw earlier. I get this form, which I have started filling in:. The Title is used on the website, the Slug is a shortened version of the title without spaces used to name the Git repository. License is GPL v2 for my projects. You can choose from any of the licenses in the list for your own Projects, and you can change the license entry later if you want to.

You will also need to enter a Description for your project.


  • Walter Benjamin (Critical Lives).
  • Navigation menu.
  • BEYOND JUSTICE;
  • Git Along Little Dogies?

Once you have this set up you'll be able to click on the mainline entry for the Project like we did with Read Etexts before and see something like this:. The next step is to convert our project files into a local Git repository, add the files to it, then push it to the repository on git. We need to do this because you cannot clone an empty repository, and our remote repository is currently empty. To get around that problem we'll push the local repository out to the new remote repository we just created, then clone the remote one and delete our existing project and its Git repository.

From then on we'll do all our work in the cloned repository. This process may remind you of the Edward Albee quote, " Sometimes a person has to go a very long distance out of his way to come back a short distance correctly". Fortunately we only need to do it once per project. Enter the commands shown below in bold after making you project directory the current one: I have made an empty local Git repository with git init , then I've used git add to add the important files to it.

In fact git add doesn't actually add anything itself; it just tells Git to add the file on the next git commit. Finally git commit with the options shown will actually put the latest version of these files in my new local repository.