Ian, I use something similar for my setup.py for my pygames.

You can view it here: http://hg.thadeusb.com/public/.r/Games/MyRTS/file/4dfc6b0d398b/src/setup.py

And I explain it a bit in the comments on my blog post http://blog.thadeusb.com/2009/04/15/pygame-font-and-py2exe/

Basically, i use a * in the data_files list and then the code lines 105-121 take care of the recursive include.

Hopefully that helps! If you feel like posting your whole project I might be able to help you more.

-Thadeus




On Tue, Oct 13, 2009 at 9:57 AM, Ian Mallett <geometrian@gmail.com> wrote:
Hello,

I'm trying to compile something for a friend.  The architecture of the program is a .py file that uses .py files in three other directories (not packages, like in site-packages): "retrogamelib/", "lib/", and "data/".  I would like to see a fully recursive version of this, but for now, here's what I've got:

#Parameters
file = "run_game.py"
optimization = 2
compress = True
bundle = True
name = "BubbMan2-DX"
version = "1.0"
description = ""
author = "PyMike"
directories = ["retrogamelib","lib","data"]
exclude = ["email","_ssl","pyreadline","difflib","doctest","locale","optparse","pickle","calendar"]
dll_exclude = ["oci.dll","msvcr71.dll"]
icon = None

#Code
from distutils.core import setup
import py2exe
import sys, os

data_files = []
for directory in directories:
    list_of_files = os.listdir(directory)
    files = (directory,list_of_files)
    data_files.append(files)
print data_files

console_windows = 1
options={"py2exe":{"unbuffered":True,
                   "optimize":optimization,
                   "excludes":exclude,
                   "dll_excludes":dll_exclude,
                   "compressed":compress,
                   "bundle_files":bundle,
                   "packages":directories
                   }
        }
console_window_data = {"script":file}
if icon != None:
    console_window_data.update(  {"icon_resources":[(1,icon)]}  )
if console_windows == 1:
    setup(console=[console_window_data],options=options,name=name,version=version,\
          description=description,author=author,zipfile=None,data_files=data_files)
else:
    setup(windows=[console_window_data],options=options,name=name,version=version,\
          description=description,author=author,zipfile=None,data_files=data_files)


Unfortunately, it does not seem to work.  It can't find the first required file in one of the subdirectories (I checked; it's there).  Help?

Thanks,
Ian

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Py2exe-users mailing list
Py2exe-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/py2exe-users