Labs/Ubiquity/Ubiquity 0.1 Development Tutorial

From MozillaWiki
Jump to navigation Jump to search

If you just want to write new commands for Ubiquity, you should read the Command Author Tutorial instead. This page is about how to do development on the Ubiquity core.

Getting Set Up

Getting the Source

It is pretty easy to get involved with the development of Ubiquity. Start off by introducing yourself on the irc channel #ubiquity on irc.mozilla.org.

We use Mercurial [1] for version control. It is very easy to install if you've got Python 2.5 with setuptools. Just type:

 easy_install Mercurial

Once installed, you will be able to checkout the current source using the command:

 hg clone http://hg.toolness.com/ubiquity-firefox

Installing the Source Version of the Extension

Uninstall your current version of Ubiquity from your Firefox Addons and then run:

 python manage.py install

This will generate a new build of the Ubiquity extension from the source checkout and install it with your local Firefox instance.

If you have a separate profile that you'd prefer to install the extension under, such as 'testing', you can add that as an optional parameter:

 python manage.py install testing

Now you are all set to become a pro Ubiquity hacker!

Development

The heart of the code can be found in the subdirectory:

  ubiquity/chrome/content/


Note: There is no need for you to keep on rebuilding your Extension after the first time. The changes to the manage.py built Extension are updated whenever you save updates to the source files and restart Firefox.

Don't Forget to Test

Make sure you run the test suite before committing your changes. From the root directory of your checkout, run:

   python manage.py test

Another way to run the same test suite is by visiting this page:

 chrome://ubiquity/content/test.html

Due to slight differences between running javascript code in xpcshell on the command line, and running it in an html page, a test occasionally will fail on the html page even though it succeeds on the command line. In that case, you can ignore the failure on the html page.

Keeping Up to Date

I recommend that you frequently update your repository to get the latest changes from the central repository. In case you're not familiar with using Mercurial, pulling the code is a two-step process:

hg pull
hg update

You can also view the latest changes to the central repository on the web at hg.toolness.com.

Finding Something to Work On

We use this Wiki [2] and Getsatisfaction [3] as places to get feature requests and bug reports. These feed into an internal Trac-based ticketing system [4].

Login to the Trac [5] using an OpenID account. Look for unassigned tickets (these are the ones that say "New" in the status column as opposed to "Assigned"). Check out what needs to be done, add things appropriately, choose unassigned tickets and start hacking!


Submitting Patches