[Pythonmac-SIG] py2app help requested: data files (and where are the examples?)
Russell E. Owen
rowen at cesmail.net
Tue Jan 24 22:08:16 CET 2006
In article <EA843E50-D019-451C-A78A-4565C6175322 at redivi.com>,
Bob Ippolito <bob at redivi.com> wrote:
> On Jan 23, 2006, at 3:24 PM, Russell E. Owen wrote:
>
> > I'm trying to convert from bundlebuilder to py2app to build my
> > application. (...and having trouble getting my data files imported...)
> >...
> > Here are the elements of data_files:
> > ('/Users/rowen/TUIRoot/TUI/Help', 'Contents/Resources/TUI/Help')
> > ('/Users/rowen/TUIRoot/TUI/Scripts', 'Contents/Resources/TUI/Scripts')
> > ('/Users/rowen/TUIRoot/TUI/Sounds', 'Contents/Resources/TUI/Sounds')
> > ('/Users/rowen/TUIRoot/RO/Bitmaps', 'Contents/Resources/RO/Bitmaps')
> > ('/Library/Tcl/snack2.2',
> > 'Contents/Frameworks/Tcl.Framework/Resources/snack2.2')
> >...
>
> data_files is incorrect. I'm not sure why what you have works
> elsewhere, but it's not documented to work. data_files needs to look
> like this:
>
> data_files=[
> (destination_dir, [srcfile, ...]),
> ]
Oops. Good catch. I was mixing up my bundlebuilder script and my py2exe
script.
> > Also, as an aside, where are the examples installed? I've searched for
> > them in vain. (I also tried inspecting the py2app installer
> > package, but
> > wasn't sure what to do with the .pax file.)
>
> This is actually documented:
> http://undefined.org/python/py2app.html
Thanks! (It wasn't in the local manual, which I thought was the same as
the on-line version, but there have obviously been some useful
additions!)
Everything is now working great. Thank you very much for the help!
A few tips for others:
- data_files get copied before frameworks. If you have data that has to
go somewhere into frameworks (in my case the tcl snack library), you may
have to move it there later, because if it's copied too soon it may
create a directory that should have been a link, making the framework
import fail. In my case, I have data_files import snack somewhere
innocuous (Contents/Resources) and then move it later with os.rename.
- Tkinter users can save 11Mb if you clear out the documentation. For
ActiveState Tcl, English version, this is in:
Contents/Frameworks/Tcl.Framework/Resources/English.lproj/ActiveTcl-8.4
- Speaking of Tkinter, if you're not using 8.4.11 you should definitely
upgrade. It has some very important bug fixes for Aqua Tk.
-- Russell
More information about the Pythonmac-SIG
mailing list