I've got a script that is an executable and it reads template files that
should be packaged with the script. How do I tell the script where to
find the templates?

In distutils, there's a package_data option, but that installs the
templates under the /usr/lib/pythonX.XX/... directory, which seems like
the wrong directory in the unix hierarchy. Traditionally, this kind of
data goes under /usr/share. There's also the data_files option, but that
can be overridden on the install command line with --install-data
directory, and the scripts/modules don't get informed (or do they? if so,

Googling around, people seem to write big install scripts to get around
this, subclassing from distutils/setuptools and "manually" replacing
certain tags in their modules with the final data directory. Is that the
only way to do this properly? Is there a pre-packaged solution not in
Python's library that takes care of it, maybe similarly to the auto-tools
config.h.in substitution? If so, could someone point me to it?


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
postedOct 17, '10 at 9:56a
activeOct 17, '10 at 9:56a

1 user in discussion

Alejandro Dubrovsky: 1 post



site design / logo © 2022 Grokbase