Changes

Jump to navigation Jump to search
m
no edit summary
Line 1: Line 1: −
<noinclude>{{GoogleTrans-en}}{{TOCright}}</noinclude>
+
<noinclude></noinclude>
 
==Editing==
 
==Editing==
This describes how to reprogram activities using Sugar and the activities Browse, Pippy & Terminal. It does not require any extra development tools. Development is done directly on the OLPC XO, alternatively it can be done using the [[Live CD]], [[Sugar on a Stick]] or other implementations of Sugar.  
+
This describes how to reprogram activities using just the tools that come with the Sugar operating system. It does not require any extra development tools. Development is done directly on the OLPC XO, alternatively it can be done using the [[Live CD]], [[Sugar on a Stick]] or other implementations of Sugar.  
   −
This page is targeted at beginners, more experienced users may find reading [[Activities/Turtle Art/Patching]] , [[Activity_Team/Resources]] and [[Activity_Team/Creating_a_New_Activity]] useful.
+
This page is targeted at beginners, more experienced users may find reading [[Activities/Turtle Art/Patching]] , [[Activity Team/Resources]] and [[Activity Team/Creating a New Activity]] useful.
   −
The activities are  stored  at ''/home/olpc/Activities'' and you can use the browser as a "file manager" to browse the file system using the URL prefix ''file://''
+
The activities are  stored  at ''/home/olpc/Activities'' and you can use Browse as a "file manager" to browse the file system using the URL prefix ''file://''
   −
For example, type ''file:///home/olpc/Activities/TurtleArt.activity'' into the browser address bar to see the Python files that make up the TurtleArt activity. Click on one of the *.py files to inspect the code.
+
For example, type ''file:///home/olpc/Activities/TurtleArt.activity'' into the browser address bar to see the Python files that make up the Turtle Art activity. Click on one of the *.py files to inspect the code.
   −
You can view the code but not edit it in the browser.  
+
You can view the code but not edit it in Browse.  
   −
There are 3 options for file editing
+
There are the following options for file editing
* the vi editor
+
===The vi editor===
* using gedit from the Sugar terminal
+
In terminal type
* the GNOME desktop on dual boot laptops
+
  vi ''filename''
* using write as described below:
+
The syntax of vi is obscure for the unfamiliar.
   −
To edit, select the code and copy to the clipboard (ctrl c) and open Pippy (the Python editor) and paste it to the code window (ctrl v). You can then edit the code and save it to the Journal, ''keep as Pippy document'' and using a suitable filename (eg ''filename.py'')
+
* an alternate to vi is to install GEdit, to download and install Gedit type
 +
su yum install gedit
 +
in sugar terminal (satellit 06/09/2010)
 +
 
 +
===The GNOME desktop on dual desktop laptops===
 +
Double click on "Computer" to navigate, double clicking a file will open it in GEdit.
 +
 
 +
===Using GEdit from Terminal===
 +
GEdit will be found on dual desktop systems, notably the [http://people.sugarlabs.org/bernie/olpc/f11-xo1-0.88/ Paraguay builds].
 +
If used as above, it does not allow editing in directories above /home/olpc.
 +
To access the higher level directories run GEdit from Terminal in either Sugar or GNOME and use the su or sudo commands. (If editing OLPC system level files, it is wise to have backed up important work and know how to [http://wiki.laptop.org/go/Clean-install_procedure reflash the operating system]).
 +
  su
 +
  gedit
 +
or
 +
  sudo gedit
 +
 
 +
===Using Pippy or Write===
 +
 
 +
To edit, select the code in Browse and copy to the clipboard (ctrl c) and open Pippy (the Python editor) and paste it to the code window (ctrl v). You can then edit the code and save it to the Journal, ''keep as Pippy document'' and using a suitable filename (eg ''filename.py'')
    
To run the modified code, you need to copy it from the journal back to the directory that the activity resides in, in this case  ''/home/olpc/Activities/TurtleArt.activity''
 
To run the modified code, you need to copy it from the journal back to the directory that the activity resides in, in this case  ''/home/olpc/Activities/TurtleArt.activity''
Line 33: Line 51:  
     mv filename..py filename.py
 
     mv filename..py filename.py
    +
===Develop Activity===
 
There is an activity [http://wiki.laptop.org/go/Develop Develop] which has a file manager and an editor, currently (at writing this) version 35 seems to be buggy. It shares the limitation with the above method that it saves to the journal, not the activity's directory. If working OK, its only benefit may be avoiding the step of copying from Browse to Pippy
 
There is an activity [http://wiki.laptop.org/go/Develop Develop] which has a file manager and an editor, currently (at writing this) version 35 seems to be buggy. It shares the limitation with the above method that it saves to the journal, not the activity's directory. If working OK, its only benefit may be avoiding the step of copying from Browse to Pippy
   −
==Modifying TurtleArt Files==
+
==Turtle in a pond==
(see also [[Activities/TurtleArt-0.88#Programmable_Brick]])
+
[[Activities/Turtle in a Pond]] is an Activity designed to be modified. Keep the Turtle in the pond. Write your own short Python program.
 +
 
 +
==Modifying Turtle Art Files==
 +
(see also [[Activities/Turtle Art-0.88#Programmable_Brick]])
    
Turtle Art has a special block that is programmable in Pippy. Look for the tamyblock.py entry in your Journal. Try uncommenting one of the examples.
 
Turtle Art has a special block that is programmable in Pippy. Look for the tamyblock.py entry in your Journal. Try uncommenting one of the examples.
Line 76: Line 98:     
===turtleart.py===
 
===turtleart.py===
This file is not used by Sugar to launch TurtleArt but you can use it to launch TurtleArt from the terminal, go to ''/home/olpc/Activities/TurtleArt.activity'' and type
+
This file is not used by Sugar to launch Turtle Art but you can use it to launch Turtle Art from the terminal, go to ''/home/olpc/Activities/TurtleArt.activity'' and type
    
  python turtleart.py
 
  python turtleart.py
Line 103: Line 125:  
[[Image:Bad_heading.jpg]]<br>
 
[[Image:Bad_heading.jpg]]<br>
   −
===Localizing TurtleArt===
+
===Localizing Turtle Art===
 
The best way to contribute to translations for Sugar Activities is through http://translate.sugarlabs.org/ In the next release cycle, your translations will be available to millions of users.
 
The best way to contribute to translations for Sugar Activities is through http://translate.sugarlabs.org/ In the next release cycle, your translations will be available to millions of users.
   −
Here follows a quick and dirty hack to add translations to a local copy of TurtleArt.  
+
Here follows a quick and dirty hack to add translations to a local copy of Turtle Art.  
   −
For TurtleArt, the translations' source resides at /home/olpc/Activities/TurtleArt.activity/po For example, the Slovenian translation source is in sl.po. The file consists of untranslated and translated string pairs:
+
For Turtle Art, the translations' source resides at /home/olpc/Activities/TurtleArt.activity/po For example, the Slovenian translation source is in sl.po. The file consists of untranslated and translated string pairs:
    
  msgid "untranslatedstring"
 
  msgid "untranslatedstring"

Navigation menu