]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distutils/command/install_headers.py
Reworked how stock objects are initialized. They now have an
[wxWidgets.git] / wxPython / distutils / command / install_headers.py
CommitLineData
1e4a197e
RD
1"""distutils.command.install_headers
2
3Implements the Distutils 'install_headers' command, to install C/C++ header
4files to the Python include directory."""
5
6# This module should be kept compatible with Python 1.5.2.
7
8__revision__ = "$Id$"
9
10import os
11from distutils.core import Command
12
13
14class install_headers (Command):
15
16 description = "install C/C++ header files"
17
18 user_options = [('install-dir=', 'd',
19 "directory to install header files to"),
20 ('force', 'f',
21 "force installation (overwrite existing files)"),
22 ]
23
24 boolean_options = ['force']
25
26 def initialize_options (self):
27 self.install_dir = None
28 self.force = 0
29 self.outfiles = []
30
31 def finalize_options (self):
32 self.set_undefined_options('install',
33 ('install_headers', 'install_dir'),
34 ('force', 'force'))
35
36
37 def run (self):
38 headers = self.distribution.headers
39 if not headers:
40 return
41
42 self.mkpath(self.install_dir)
43 for header in headers:
44 (out, _) = self.copy_file(header, self.install_dir)
45 self.outfiles.append(out)
46
47 def get_inputs (self):
48 return self.distribution.headers or []
49
50 def get_outputs (self):
51 return self.outfiles
52
53# class install_headers