Help with Distutils

David M. Cooke cookedm+news at physics.mcmaster.ca
Thu May 13 16:51:48 EDT 2004


At some point, Jorge Godoy <godoy at ieee.org> wrote:

> 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. 

Of course, you have to able to find the config file, but that's a
smaller kettle of fish. I suppose you could put the config file in
your modules directory (like I suggested), and have your other data
files sitting outside (in /usr/share/whatever).

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca



More information about the Python-list mailing list