[Distutils] find_package_data function
Ian Bicking
ianb at colorstudy.com
Thu Oct 6 01:08:26 CEST 2005
I wrote a simple find_package_data function:
http://svn.pythonpaste.org/Paste/trunk/paste/util/finddata.py
(if you want to use it, you should copy it into your own source)
At first I made it just generate a list of wildcards with all the
(non-package) subdirectories enumerated, e.g., 'mypackage': ['*.pt',
'templates/*.pt', 'templates/admin/*.pt']. But I decided it's too easy
to miss files that way. So now it enumerates everything except files
and directories you exclude with patterns (or with explicit paths).
There's still no way to include empty directories.
You use it like:
...
package_data=find_package_data()
Which should give a reasonable set. Pass show_ignored=True to see more
of what it is doing.
--
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Distutils-SIG
mailing list