Changes

Jump to navigation Jump to search
Line 54: Line 54:     
If you have an XO, I'm sure you want to take a look at [[User:Humitos/x2x|this]]...
 
If you have an XO, I'm sure you want to take a look at [[User:Humitos/x2x|this]]...
 +
 +
== Use Extended Python debugger ==
 +
 +
There is a library called '''epdb''' and it's useful to inspect the code while the Activity is running. I'm using this module when I'm not sure about the type of an object or I can test some different things that the code says in some point. So, I installed this package on my Fedora 17 by running this command
 +
 +
sudo yum install python-epdb
 +
 +
After that I put some trace point in the code where I can stop and make my tests by doing this:
 +
 +
import epdb;epdb.set_trace()
 +
 +
Finally I run Get Books Activity from the Terminal Activity to be able to write some code on a shell. This is the command that I use:
 +
 +
sugar-launch org.laptop.sugar.GetBooksActivity
    
= Code Snippets =
 
= Code Snippets =
266

edits

Navigation menu