summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2000-05-12 00:52:23 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2000-05-12 00:52:23 (GMT)
commitb2e3bb3d6aaf4ef04211b932c64ef9cd5adc56bb (patch)
treee8d4e539fef4c83ccbf22ee1169a8e21cc25ddc9 /Lib/distutils/command
parentbb8c71d56370a97d2c9b5db0935475f1c99d422a (diff)
downloadcpython-b2e3bb3d6aaf4ef04211b932c64ef9cd5adc56bb.zip
cpython-b2e3bb3d6aaf4ef04211b932c64ef9cd5adc56bb.tar.gz
cpython-b2e3bb3d6aaf4ef04211b932c64ef9cd5adc56bb.tar.bz2
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.)
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r--Lib/distutils/command/__init__.py2
-rw-r--r--Lib/distutils/command/install.py5
-rw-r--r--Lib/distutils/command/install_data.py14
-rw-r--r--Lib/distutils/command/install_scripts.py16
4 files changed, 36 insertions, 1 deletions
diff --git a/Lib/distutils/command/__init__.py b/Lib/distutils/command/__init__.py
index 385330b..573ae51 100644
--- a/Lib/distutils/command/__init__.py
+++ b/Lib/distutils/command/__init__.py
@@ -11,6 +11,8 @@ __all__ = ['build',
'build_clib',
'install',
'install_lib',
+ 'install_scripts',
+ 'install_data',
'clean',
'sdist',
'bdist',
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index c70ed9a..3f6fa33 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -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):
diff --git a/Lib/distutils/command/install_data.py b/Lib/distutils/command/install_data.py
new file mode 100644
index 0000000..f86d95e
--- /dev/null
+++ b/Lib/distutils/command/install_data.py
@@ -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)
diff --git a/Lib/distutils/command/install_scripts.py b/Lib/distutils/command/install_scripts.py
new file mode 100644
index 0000000..665208e
--- /dev/null
+++ b/Lib/distutils/command/install_scripts.py
@@ -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)