PyXR

c:\python24\lib \ distutils \ command \ install_headers.py



0001 """distutils.command.install_headers
0002 
0003 Implements the Distutils 'install_headers' command, to install C/C++ header
0004 files to the Python include directory."""
0005 
0006 # This module should be kept compatible with Python 1.5.2.
0007 
0008 __revision__ = "$Id: install_headers.py,v 1.10 2002/11/19 13:12:28 akuchling Exp $"
0009 
0010 import os
0011 from distutils.core import Command
0012 
0013 
0014 class install_headers (Command):
0015 
0016     description = "install C/C++ header files"
0017 
0018     user_options = [('install-dir=', 'd',
0019                      "directory to install header files to"),
0020                     ('force', 'f',
0021                      "force installation (overwrite existing files)"),
0022                    ]
0023 
0024     boolean_options = ['force']
0025 
0026     def initialize_options (self):
0027         self.install_dir = None
0028         self.force = 0
0029         self.outfiles = []
0030 
0031     def finalize_options (self):
0032         self.set_undefined_options('install',
0033                                    ('install_headers', 'install_dir'),
0034                                    ('force', 'force'))
0035 
0036 
0037     def run (self):
0038         headers = self.distribution.headers
0039         if not headers:
0040             return
0041 
0042         self.mkpath(self.install_dir)
0043         for header in headers:
0044             (out, _) = self.copy_file(header, self.install_dir)
0045             self.outfiles.append(out)
0046 
0047     def get_inputs (self):
0048         return self.distribution.headers or []
0049 
0050     def get_outputs (self):
0051         return self.outfiles
0052 
0053 # class install_headers
0054 

Generated by PyXR 0.9.4
SourceForge.net Logo