Differences between revisions 1 and 2
Revision 1 as of 2003-11-06 01:40:30
Size: 576
Editor: dclient217-162-156-158
Comment:
Revision 2 as of 2003-11-06 02:16:09
Size: 617
Editor: dclient217-162-156-158
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Let's say you're not entirly happy with one detail in the build process of py2exe. That may be beacus you want to filter the list of files that it collects or somthing else. = customizing py2exe by subclassing =
Let's say you're not entirely happy with one detail in the build process of py2exe. That may be beacuse you want to filter the list of files that it collects or somthing else.
Line 10: Line 11:
Then in the setup() call we need to tell DistUtils that it should use out class: Then in the setup() call we need to tell DistUtils that it should use our class:
Line 18: Line 19:
In fact, that mechanism allows to install any distutils command. In fact, that mechanism allows to install any DistUtils command.

customizing py2exe by subclassing

Let's say you're not entirely happy with one detail in the build process of py2exe. That may be beacuse you want to filter the list of files that it collects or somthing else.

Make subclass of py2exe and override the methods you want to change:

from py2exe.build_exe import py2exe as build_exe
class my_py2exe(build_exe):
    ....

Then in the setup() call we need to tell DistUtils that it should use our class:

setup(...
      cmdclass = {"py2exe": my_py2exe},
      ...
)

In fact, that mechanism allows to install any DistUtils command.

SubclassingPy2Exe (last edited 2008-07-08 11:27:43 by localhost)