Patch from Bastien Kleineidam:

adds the 'install_data' and 'install_scripts' commands; these two
are trivial thanks to the 'install_misc' base class in cmd.py.
(Minor tweaks and commentary by me; the code is untested so far.)
This commit is contained in:
Gregory P. Smith 2000-05-12 00:52:23 +00:00
parent bb8c71d563
commit b2e3bb3d6a
6 changed files with 68 additions and 1 deletions

View file

@ -11,6 +11,8 @@ __all__ = ['build',
'build_clib',
'install',
'install_lib',
'install_scripts',
'install_data',
'clean',
'sdist',
'bdist',

View file

@ -90,7 +90,10 @@ class install (Command):
# (func, command) where 'func' is a function to call that returns
# true if 'command' (the sub-command name, a string) needs to be
# run. If 'func' is None, assume that 'command' must always be run.
sub_commands = [(None, 'install_lib')]
sub_commands = [(None, 'install_lib'),
(None, 'install_scripts'),
(None, 'install_data'),
]
def initialize_options (self):

View file

@ -0,0 +1,14 @@
from distutils.cmd import install_misc
class install_data (install_misc):
description = "install data files"
def finalize_options (self):
self._install_dir_from('install_data')
def run (self):
self._copydata(self.distribution.data)
def get_outputs (self):
return self._outputdata(self.distribution.data)

View file

@ -0,0 +1,16 @@
from distutils.cmd import install_misc
class install_scripts(install_misc):
description = "install scripts"
# XXX needed?
user_options = [('install-dir=', 'd', "directory to install to")]
def finalize_options (self):
self._install_dir_from('install_scripts')
def run (self):
self._copydata(self.distribution.scripts)
def get_outputs(self):
return self._outputdata(self.distribution.scripts)