System requirements for leo.py
------------------------------

leo.py requires Python 2.2.1 or above and tcl/tk 8.4 or above.

	Download Python from http://python.org/ 
	Download tcl/Tk from http://tcl.activestate.com/software/tcltk/

Warning: When building Tcl on Linux, do not specify "--enable-threads" .
Only use Tcl with the default "threads not enabled" case.

Installing the leo.py on Linux
------------------------------

Download the latest version of Leo (a .zip file) from: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

Unzip the downloaded .zip file into a folder in your home directory.
The folder will be called something like leo-4-4-8.

You now have two choices:

1. You can run Leo from your home directory.
Just add  ~/leo-4-4-8 to your path.

2. You can install leo into \usr\local\lib and \usr\local\bin by running Leo's install script as follows::

    cd ~/leo-4-4-8
    chmod u+x install
    sudo ./install

The install script will instruct you to add \usr\local\bin to your path.

Installing the leo.py on Windows
--------------------------------

Leo is distributed either as an executable installer (.exe) file or as a .zip file.

To install Leo using the executable installer:

    1. Download the latest version of Leo's installer from:    
       http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106
       The installer will be called something like LeoSetup-4-4-3.exe.

    2. Run the installer.
       By default, the install will install Leo in your 'Program Files' directory.

To install Leo from the .zip file:

    1. Download the latest version of Leo (a .zip file) from:    
       http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106

    2. Unzip the .zip file and place the unpacked leo folder in 
       the 'Program Files' folder or any convenient location.

After you have installed Leo, you should add the location of your leo/src folder to your python path.
One way to do this is adding something like the following to python/Lib/sitecustomize.py:

    import sys
    sys.path.append(r'<path-to-leo>leo\src')

Another way is to append <path-to-leo> to the Windows PYTHONPATH environment variable.

Installing leo.py on MacOs
--------------------------

Leo works reliably only on MacOS X 10.3 and above.

To run Leo on Macintosh OS X 10.3 (There will be slight changes for later versions of Mac Os X):

1) Download and install "MacPython 2.3 for Panther addons".

Python is already included in OS X 10.3 so only the addons are necessary

	http://www.cwi.nl/~jack/macpython.html

2) Download and install TclTkAqua.

	http://tcltkaqua.sourceforge.net/

3) Run the PackageManager found in /Applications/MacPython-2.3 and  
install "_tkinter-2.3-binary" by clicking on the package in the list  
and clicking the [Install:] button with "Install dependencies" checked

4)  Install Leo.  There are two ways to do this.

a)  The NEW way: Download Leo-version-number.pkg from

    http://leo.sourceforge.net/

Double-click Leo.pkg to install the Leo folder. I recommend that you install Leo
in your home directory.

b) The OLD way: Download Leo-version-number.zip:

	http://leo.sourceforge.net/

Unzip the contents into the desired directory by double-clicking the downloaded file.

5) Run Leo by ontrol-clicking on /path_to_unzipped_dir/leo/src/leo.py and open
with PythonLauncher.

6) It is a good idea to set PythonLauncher as the default program to  
open python scripts by clicking on "leo.py", choosing Get Info from the  
Finder's File menu, and selecting "PythonLauncher" as the default  
program to "Open With:"

By clicking the "Change All..." button, all python scripts will be  
opened with PythonLauncher.

8) (optional) Download and install Pmw. (Leo now contains Pmw in the extensions folder).

    http://pmw.sourceforge.net/

Pmw must be installed in order to use the Settings panel.

Drag the downloaded gzip file into

/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages

Double click on it to unzip and untar the file into a folder to make it
available to Python

Thanks to Randall Voth for these instructions.

Using shell scripts and batch files to make using Leo easier
------------------------------------------------------------

On Linux, the following shell script will allow you to open foo.leo files by typing leo foo

#!/bin/sh 
python <leopath>/leo.py $1

where <leopath> is replaced with the path to the leo directory. 

On Windows, the equivalent batch file would be:

c:\python22\python <leopath>leo.py "%1"

