McMillan's Installer question

Gordon McMillan gmcm at hypernet.com
Sun Aug 11 00:43:25 CEST 2002


Adonis wrote:

> i was reading the documentation, and got slightly confused on how to add
> extra files, such as images/doc/etc. how can this be done?

The docs say:

You can force the include of any file in much the same way you do excludes.

         collect = COLLECT(a.binaries + 
                    [('readme', '/my/project/readme', 'DATA')], ...)
        

or even

         collect = COLLECT(a.binaries, 
                    [('readme', '/my/project/readme', 'DATA')], ...)

If you want the distribution to have images/doc/readme,
just make that:
 [('images/doc/readme', '/my/project/whatever/readme', 'DATA')]

There's no problem in inserting extra Python code in the spec
file:
 
import glob, os
extrastuff = glob.glob('/my/project/*.html')
extra = []
for fnm in extrastuff
    target = os.path.join('images', 'doc', os.path.basename(fnm))
    extra.append((target, fnm, 'DATA'))

collect = COLLECT(a.binaries, extra, ...)

If you're doing a --onefile, it's a bit harder, but that's as
it should be :-).

-- Gordon
http://www.mcmillan-inc.com/





More information about the Python-list mailing list