App Engine Python SDK version 1.9.9
[gae.git] / python / lib / distutils / distutils / command / install_headers.py
blobd892416a8ccd9c6374eaaef3cc373698a972a22e
1 """distutils.command.install_headers
3 Implements the Distutils 'install_headers' command, to install C/C++ header
4 files to the Python include directory."""
6 __revision__ = "$Id$"
8 from distutils.core import Command
11 # XXX force is never used
12 class install_headers(Command):
14 description = "install C/C++ header files"
16 user_options = [('install-dir=', 'd',
17 "directory to install header files to"),
18 ('force', 'f',
19 "force installation (overwrite existing files)"),
22 boolean_options = ['force']
24 def initialize_options(self):
25 self.install_dir = None
26 self.force = 0
27 self.outfiles = []
29 def finalize_options(self):
30 self.set_undefined_options('install',
31 ('install_headers', 'install_dir'),
32 ('force', 'force'))
35 def run(self):
36 headers = self.distribution.headers
37 if not headers:
38 return
40 self.mkpath(self.install_dir)
41 for header in headers:
42 (out, _) = self.copy_file(header, self.install_dir)
43 self.outfiles.append(out)
45 def get_inputs(self):
46 return self.distribution.headers or []
48 def get_outputs(self):
49 return self.outfiles
51 # class install_headers