Mercurial > hg > mercurial-crew-with-dirclash
comparison setup.py @ 1422:a7e8408ac79c
py2exe is not able to handle win32com.shell
Changes:
- setup.py: help py2exe finding the shell module in win32com.shell
author | Volker Kleinfeld <Volker.Kleinfeld@gmx.de> |
---|---|
date | Mon, 24 Oct 2005 14:52:41 -0700 |
parents | a7631cf1326a |
children | b254243b7159 |
comparison
equal
deleted
inserted
replaced
1421:a7631cf1326a | 1422:a7e8408ac79c |
---|---|
4 # | 4 # |
5 # './setup.py install', or | 5 # './setup.py install', or |
6 # './setup.py --help' for more options | 6 # './setup.py --help' for more options |
7 | 7 |
8 import glob | 8 import glob |
9 import sys | |
9 from distutils.core import setup, Extension | 10 from distutils.core import setup, Extension |
10 from distutils.command.install_data import install_data | 11 from distutils.command.install_data import install_data |
11 | 12 |
12 import mercurial.version | 13 import mercurial.version |
13 | 14 |
14 # py2exe needs to be installed to work | 15 # py2exe needs to be installed to work |
15 try: | 16 try: |
16 import py2exe | 17 import py2exe |
18 | |
19 # Help py2exe to find win32com.shell | |
20 try: | |
21 import modulefinder | |
22 import win32com | |
23 for p in win32com.__path__[1:]: # Take the path to win32comext | |
24 modulefinder.AddPackagePath("win32com", p) | |
25 pn = "win32com.shell" | |
26 __import__(pn) | |
27 m = sys.modules[pn] | |
28 for p in m.__path__[1:]: | |
29 modulefinder.AddPackagePath(pn, p) | |
30 except ImportError: | |
31 pass | |
17 | 32 |
18 # Due to the use of demandload py2exe is not finding the modules. | 33 # Due to the use of demandload py2exe is not finding the modules. |
19 # packagescan.getmodules creates a list of modules included in | 34 # packagescan.getmodules creates a list of modules included in |
20 # the mercurial package plus depdent modules. | 35 # the mercurial package plus depdent modules. |
21 import mercurial.packagescan | 36 import mercurial.packagescan |