Basic usage

Place the reloc.py file somewhere, where your python script can import it and then import it:

import reloc

Now you can use reloc to replace your paths. For example replace

glade = gtk.glade.XML('/usr/share/myproject/main.glade')

with

glade = gtk.glade.XML(os.path.join(reloc.DATADIR, 'myproject/main.glade'))

Other Variables are:

EXE         Path to your main python script (__file__).
EXEDIR      The directory of your python script.
PREFIX      The prefix, e.g. "/usr".
BINDIR      PREFIX + "/bin"
SBINDIR     PREFIX + "/sbin"
DATADIR     PREFIX + "/share"
LIBDIR      PREFIX + "/lib"
LIBEXECDIR  PREFIX + "/libexec"
ETCDIR      PREFIX + "/etc"
LOCALEDIR   DATADIR + "/locale"
