te: this information is relevant to `py2app`_ 0.1.2 - which is currently just on the `svn trunk`_)
In order to see how hard it would be to package a complicated application such as `wxGlade`_, I decided to give it a try. `wxGlade`_ is quite a dynamic beast with regard to code generation and widget plugins, so it was a bit of a pain to deal with. I actually had to add several features to `py2app`_ in the process:
* A feature where one module can be "aliased" to another module. I needed this because wxPython.wx points to wx, but is not actually on the filesystem.
* An extensible module filtering system, so a recipe can say "yes" or "no" to any extension or python module it comes across. Before this, there was only one static filter that would say "no" to standard library modules when using a vendor Python.
`wxGlade`_ causes problems because it needs to list the "codegen" and "widgets" directories, and load code from them. This would be easy if:
* The path were configurable in some way (using sys.path, a separate variable, etc.). Packages go into .../Python/site-packages/, where it expected to see them at .../
* The list of modules were configurable in some way (right now it expects to perform an os.listdir)
The naive way would be to just include them as data files, however this prevents dependency analysis from occurring. It turns out that `wxGlade`_ did indeed cause new dependencies in these modules so a more complicated solution was required. The solution to this particular problem is in three parts:
1. Add "codegen" and "widgets" as data files
2. Add a wxglade recipe that scans all of these plugins for dependencies
3. Have the wxglade recipe install a filter that makes sure these dependencies aren't copied into the normal place
The other customization I used was a custom boot script, wxGlade.py. This boot script does two things:
1. Starts up wxGlade as per wxglade.py, but in a simpler way (less is needed, the environment is already sane)
2. Monkeypatches a bug in `wxGlade`_ so that it can open the help files
Note that setup.py expects a `wxGlade 0.3.4`_ distribution to be unpacked in ./wxGlade-0.3.4
.. _`py2app`: http://undefined.org/python/#py2app
.. _`svn trunk`: http://svn.red-bean.com/bob/py2app/trunk
.. _`wxGlade`: http://wxglade.sourceforge.net/
.. _`wxGlade 0.3.4`: http://sourceforge.net/project/showfiles.php?group_id=58225&package_id=54072&release_id=264401
shiqizheng
- 粉丝: 2
- 资源: 1
会员权益专享
资源目录
setup.cfg 59B
dependency_links.txt 1B
not-zip-safe 0B
PKG-INFO 1KB
SOURCES.txt 5KB
top_level.txt 7B
entry_points.txt 224B
requires.txt 62B
__init__.py 8KB
README.txt 614B
NEWS.txt 17KB
lesson5.py 10KB
setup.py 170B
hello.py 458B
setup.py 168B
aclock.py 2KB
setup.py 169B
use_testpkg.py 22B
__init__.py 81B
data.txt 12B
setup.py 198B
JavaCompiling.plist 278B
keyedobjects.nib 9KB
_MainMenu_EOArchive_English.java 6KB
classes.nib 306B
info.nib 566B
aliens.icns 7KB
aliens_bootstrap.py 1KB
setup.py 537B
shot.gif 129B
bomb.gif 1KB
background.gif 9KB
alien1.gif 4KB
player1.gif 3KB
boom.wav 12KB
alien2.gif 4KB
explosion1.gif 6KB
car_door.wav 4KB
house_lo.wav 77KB
alien3.gif 4KB
aliens.py 9KB
setup.py 134B
datafile.txt 20B
myapp.py 107B
needsthis.py 83B
hello.py 655B
setup.py 92B
hello.py 1KB
setup.py 168B
Egg.icns 57KB
setup.py 612B
EggInstaller.py 1KB
hello.py 435B
setup.py 168B
setup.py 668B
doodle.py 8KB
setup.py 786B
superdoodle.py 13KB
README.txt 2KB
setup.py 2KB
wxGlade.py 573B
doodle.py 8KB
setup.py 784B
superdoodle.py 13KB
objects.nib 2KB
classes.nib 295B
info.nib 451B
TinyTinyEdit.py 1KB
objects.nib 7KB
classes.nib 110B
info.nib 484B
setup.py 569B
leases.py 734B
keyedobjects.nib 139KB
classes.nib 300B
info.nib 606B
TableModelAppDelegate.py 1KB
ICSharingWatcher.py 343B
setup.py 245B
test.py 606B
PyTestPlugin.py 423B
setup.py 446B
PKG-INFO 1KB
plist_template.py 2KB
main 150KB
main.c 33KB
__init__.py 35B
setup.py 710B
site.py 3KB
__error__.sh 449B
script_py2applet.py 5KB
boot_aliasplugin.py 501B
argv_inject.py 212B
boot_app.py 422B
site_packages.py 616B
disable_linecache.py 209B
boot_aliasapp.py 512B
chdir_resource.py 96B
argv_emulation.py 4KB
__init__.py 0B
加载中...