|
From: Brian D. <deb...@ho...> - 2007-11-21 02:17:14
|
# This is an example setup.py file
# run it from the windows command line like so:
#> C:\Python2.4\python.exe setup.py py2exe
=20
from distutils.core import setup
from Common import *
=20
import py2exe, shutil, os
# extra files/dirs copied to the project
extra_data =3D ['data','gfx','conf','help','pyPlan.rsrc.py','pyEstados.rsrc=
.py','Parametros.rsrc.py','ParamFin.rsrc.py','pyPlan.exe.manifest']
opts =3D {=20
"py2exe": {=20
# if you import .py files from subfolders of your project, then those ar=
e
# submodules. You'll want to declare those in the "includes"
"compressed": 1,
"optimize": 2,
"includes":[]
}=20
}=20
=20
setup(
version =3D APP_VERSION,
description =3D APP_DESC,
name =3D APP_NAME,
author =3D APP_AUTHOR,
=20
#this is the file that is run when you start the game from the command li=
ne. =20
windows=3D[{"script": "pyPlan.py","icon_resources": [(1, "pyplan.ico")]}]=
,
#options as defined above
options=3Dopts,
#data files - these are the non-python files, like images and sounds
#the glob module comes in handy here.
#data_files =3D [],
=20
#this will pack up a zipfile instead of having a glut of files sitting
#in a folder.
zipfile=3D"lib/shared.zip"
)
#also need to hand copy the extra files here
def installfile(name):
dst =3D os.path.join('dist')
print 'copying', name, '->', dst
if os.path.isdir(name):
dst =3D os.path.join(dst, name)
if os.path.isdir(dst):
shutil.rmtree(dst)
shutil.copytree(name, dst)
elif os.path.isfile(name):
shutil.copy(name, dst)
else:
print 'Warning, %s not found' % name
for data in extra_data:
installfile(data)
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Space=
s. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=3Dcreate&wx_url=3D/friends.=
aspx&mkt=3Den-us=
|