PyOGP Client Library Development Sandbox

From Second Life Wiki
Revision as of 08:52, 25 June 2010 by Enus Linden (talk | contribs)
Jump to navigation Jump to search

We will first run down the general explanation and add platform specific notes later.

Note

We're migrating to Mercurial... Please check back soon for updated docs.

PyOGP package install instructions need some work... stay tuned. Feel free to follow the buildout directions to use the Subversion repositories for now.

Repositories

Stable trunk repositories:

Maintenance repositories:

Defunct until someone picks them up and fixes them:

Browse the Code

If all you want to do is glance at the source code, use the bitbucket source browser:

Prerequisites

You must have the following installed:

  • Mercurial - 1.3 or greater
  • Python 2.4.4, 2.5.x, 2.6.x (untested on 3.0)

Note: Snow Leopard upgrades require a reinstall of XCode, in this case to accommodate gcc (and greenlet).

Environment Preparation

Setuptools and easy_install are Python standard means for installing modules. For more info, start here: http://pypi.python.org/pypi/setuptools.

Virtualenv is a method which allows you to create isolated Python environments, separate from your base install if you so prefer. For more, see here: http://pypi.python.org/pypi/virtualenv.

Your distribution may have Python's setuptools and virtualenv packages in its package repository. If so, it is probably best to use your normal package installation procedures (see below for information on specific Linux distributions). If the packages are not available then follow these generic instructions.

Generic *nix distribution

In order to install Python Packages and creating a development sandbox you have to do the following:

easy_install

Download ez_setup.py and run it with your Python interpreter. You can find it here: http://peak.telecommunity.com/dist/ez_setup.py

Eventually you have to be root to do this depending on your system (mostly non-windows). It should look like this on a unix based machine:

wget http://peak.telecommunity.com/dist/ez_setup.py
 -or-
curl -O http://peak.telecommunity.com/dist/ez_setup.py
sudo python ez_setup.py

virtualenv

One may choose to create an isolated python instance on your host, to be able to work with PyOGP without installing packages to your base Python install on your host.

To use a dedicated python installation in your host, install virtualenv like this:

easy_install virtualenv

Or, if you need to be root something like this:

sudo easy_install virtualenv

On windows, you may need a different path to easy_install

c:\Python25\Scripts\easy_install.exe virtualenv

setup.py

Grab the source files for each of the pyogp repos, and install them to a virtualenv instance (see above for installing virtualenv if you don't have it)..

Here's a simple setup that Enus likes:

cd ~
mkdir sandbox
cd sandbox
virtualenv . --no-site-packages
cd ~
mkdir hg
cd hg
hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.apps/
hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.lib.base/
hg clone https://enus_linden@bitbucket.org/enus_linden/pyogp.lib.client/
cd ~/hg/pyogp.lib.base
~/sandbox/bin/python setup.py install
cd ~/hg/pyogp.lib.client
~/sandbox/bin/python setup.py install
cd ~/hg/pyogp.apps
~/sandbox/bin/python setup.py install
......
now, in ~/sandbox/bin/ you'll have all kinds of pyogp executables for testing stuff out (like region_connect, etc)

You now have all the source, plus a sandbox, for tinkering with pyogp!

To try an executable out, just run it in ~/sandbox/bin/. for example:

 ~/sandbox/bin/region_connect firstname lastname

This command will login in your agent to aditi, and will prompt you for a password.

Pass any script the "-h" param to get it's usage.

Run the tests

See PyOGP_Package_Unittests for details...

The structure of the sandbox

You now might wonder what all those directories are good for. To learn more about this check out the Filesystem Structure