Help with Distutils

Jorge Godoy godoy at ieee.org
Thu May 13 15:38:01 EDT 2004


On Qui 13 Mai 2004 15:39, Johan Svedberg wrote:

> Well, the reason is that I've told setup.py to install a bunch of
> templates in <prefix>/share/myapp/templates/ and I want to make sure
> that myapp can find these no matter what <prefix> is.

I see somebody suggested that you use __file__, from the module.

Another option --- I'm using it --- is to have a config file and have
distutils to call a postinstall script (requires Python 2.3+) to update the
directory in such a config file. 

You can parse it with ConfigParser in your application. It also adds an
interesting way of putting things in different places and still having them
to work as expected :-)

-- 
Godoy.      <godoy at ieee.org>



More information about the Python-list mailing list