[pywin32-checkins] pywin32 setup_win32all.py,1.4,1.5
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <th...@us...> - 2003-12-03 08:11:30
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1:/tmp/cvs-serv9568 Modified Files: setup_win32all.py Log Message: Add a custom install_data command, which lets us remove the 'hack' in convert_data_files - the hack prevented bdist_wininst doing the right thing. Prevent running the post_install script when 'bdist_wininst' is built. Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** setup_win32all.py 3 Dec 2003 07:25:18 -0000 1.4 --- setup_win32all.py 3 Dec 2003 08:11:27 -0000 1.5 *************** *** 37,40 **** --- 37,41 ---- from distutils.command.install_lib import install_lib from distutils.command.build_ext import build_ext + from distutils.command.install_data import install_data from distutils.dep_util import newer_group from distutils import log *************** *** 42,45 **** --- 43,47 ---- from distutils.sysconfig import get_python_lib from distutils.filelist import FileList + import types, glob import os, string, sys import re *************** *** 553,556 **** --- 555,571 ---- ################################################################ + class my_install_data(install_data): + """A custom install_data command, which will install it's files + into the standard directories (normally lib/site-packages). + """ + def finalize_options(self): + if self.install_dir is None: + installobj = self.distribution.get_command_obj('install') + self.install_dir = installobj.install_lib + print 'Installing data files to %s' % self.install_dir + install_data.finalize_options(self) + + ################################################################ + pywintypes = WinExt_system32('pywintypes', dsp_file = r"win32\PyWinTypes.dsp", *************** *** 724,728 **** # get 'com/win32com/whatever' installed to 'win32com/whatever' def convert_data_files(files): - base_dir = "Lib/site-packages" ret = [] for file in files: --- 739,742 ---- *************** *** 744,748 **** if path_use.startswith("com/") or path_use.startswith("com\\"): path_use = path_use[4:] - path_use = os.path.join(base_dir, path_use) ret.append( (path_use, files_use)) return ret --- 758,761 ---- *************** *** 777,780 **** --- 790,794 ---- cmdclass = { #'install_lib': my_install_lib, 'build_ext': my_build_ext, + 'install_data': my_install_data, }, options = {"bdist_wininst": {"install_script": "pywin32_postinstall.py"}}, *************** *** 847,854 **** # And data files convert_data_files can't handle. [ ! ('Lib/site-packages\\win32com', ('com/License.txt',)), # pythoncom.py doesn't quite fit anywhere else. # Note we don't get an auto .pyc - but who cares? ! ('Lib/site-packages', ('com/pythoncom.py',)), ], ) --- 861,868 ---- # And data files convert_data_files can't handle. [ ! ('win32com', ('com/License.txt',)), # pythoncom.py doesn't quite fit anywhere else. # Note we don't get an auto .pyc - but who cares? ! ('', ('com/pythoncom.py',)), ], ) *************** *** 875,879 **** # some 'no wait' executor - spawn seems fine! We pass the PID of this # process so the child will wait for us. ! if not dist.dry_run and dist.command_obj.has_key('install'): # What executable to use? This one I guess. Maybe I could just import # as a module and execute? --- 889,894 ---- # some 'no wait' executor - spawn seems fine! We pass the PID of this # process so the child will wait for us. ! if not dist.dry_run and dist.command_obj.has_key('install') \ ! and not dist.command_obj.has_key('bdist_wininst'): # What executable to use? This one I guess. Maybe I could just import # as a module and execute? |