home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Freeware 31 / FreelogHS31.iso / Texte / scribus / scribus-1.3.3.9-win32-install.exe / lib / distutils / command / install_headers.py < prev    next >
Text File  |  2004-11-18  |  2KB  |  54 lines

  1. """distutils.command.install_headers
  2.  
  3. Implements the Distutils 'install_headers' command, to install C/C++ header
  4. files to the Python include directory."""
  5.  
  6. # This module should be kept compatible with Python 2.1.
  7.  
  8. __revision__ = "$Id: install_headers.py,v 1.11 2004/11/10 22:23:15 loewis Exp $"
  9.  
  10. import os
  11. from distutils.core import Command
  12.  
  13.  
  14. class 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
  54.