[Pythonmac-SIG] py2app standalone options

Dethe Elza delza at livingcode.org
Thu Dec 23 23:25:43 CET 2004


With regards to refactoring setup.py files, here is what I've been 
using for several different apps.  It has evolved as I've found new 
requirements.

The only things I have to change from app to app (at this point) are 
the bits in ALL_CAPS at the beginning.  I've been meaning to factor all 
of this into something like a function + .cfg, but haven't gotten there 
yet, so I just copy this into  a new project and edit the few lines 
that change.

HTH

--Dethe

<snip>
'''
Run with:
% python setup.py py2app
'''
from distutils.core import setup
import py2app

NAME = 'Oblique Strategies'
SCRIPT = 'oblique.py'
VERSION = '0.3'
ICON = NAME
ID = 'oblique_strategies'
COPYRIGHT = 'Copyright 2004 Dethe Elza'
DATA_FILES = ['English.lproj', 'data', 'MainMenu.gsmarkup', 
'MainWindow.gsmarkup', 'Credits.html']

plist = dict(
     CFBundleIconFile            = ICON,
     CFBundleName                = NAME,
     CFBundleShortVersionString  = ' '.join([NAME, VERSION]),
     CFBundleGetInfoString       = NAME,
     CFBundleExecutable          = NAME,
     CFBundleIdentifier          = 'org.livingcode.examples.%s' % ID,
     NSHumanReadableCopyright    = COPYRIGHT
)


app_data = dict(script=SCRIPT, plist=plist)
py2app_opt = dict(frameworks=['Renaissance.framework'],)
options = dict(py2app=py2app_opt,)

setup(
   data_files = DATA_FILES,
   app = [app_data],
   options = options,
)
</snip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2488 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20041223/680feff0/smime.bin


More information about the Pythonmac-SIG mailing list