On 20 Jan, 2008, at 9:26, Kenneth Miller wrote:

Charles,

That seems normal. Here's a bash script I use for compiling my application. I don't mess with the setup.py once it's generated, and this bash script seems to do the trick.

rm -r build
rm -r dist

py2applet --make-setup Decoder.py
python setup.py py2app --include DUtils,LabVIEWWrapper --packages PyDrill,mx,Ft,ZODB,persistent,transaction,zope --resources config.xml,file1.xml,file2.xml,file3.xml,logs > compile.log

cp -r /usr/local/Zope-3.3.1-Python2.5/lib/python/zope/interface / Teledrill/Applications/Python/Decoder/dist/Decoder.app/Contents/ Resources/lib/pytho
n2.5/zope/

The first two lines simply clean out the old build.
The third line creates the setup.py file.
The fourth line actually compiles the app. The include files are two .py files, local modules, that i need to include. The packages are python packages on the python path that I want to include for use. The resources are include files that my app needs, i've obscured their actual names, and the command dumps out to a log. The last line is a really silly way to correct a bug in py2app. When i tell it to include zope, it doesn't include the "interface" sub- module, so I forcefully copy it into the app.

I'm not sure if this is the right way to do it, but it's worked for me so far.

It works and hence is right in some way, but it is far less than optimal. First of all: why don't you maintain a setup.py file instead of regenerating a suboptimal one every time? All options you now pass on the command-line can also be specified in the setup.py file, which mostly does away with the need of a shell script.

Copying zope.interface manually into your application also doesn't seem right. The correct way would be to either fix the problem that causes py2app to not detect that zope.interface is needed in the first place, or to write a py2app recipe that will automaticly copy zope.interface into the app bundle when needed.

Could you on the very least create a small application that demonstrates the problem? That would make it a lot easier to debug the problem.


Ronald

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to