blob: 22ab71e79995661ea60497c91eaf841829e5b6a9 [file] [log] [blame]
Greg Ward13ae1c81999-03-22 14:55:25 +00001# created 1999/03/13, Greg Ward
2
3__rcsid__ = "$Id$"
4
5import sys
6from distutils.core import Command
7from distutils.util import copy_tree
8
9class InstallPy (Command):
10
11 options = [('dir=', 'd', "directory to install to"),
12 ('build-dir=' 'b', "build directory (where to install from)")]
13
14 def set_default_options (self):
15 # let the 'install' command dictate our installation directory
16 self.dir = None
17 self.build_dir = None
18
19 def set_final_options (self):
20 # If we don't have a 'dir' value, we'll have to ask the 'install'
21 # command for one. (This usually means the user ran 'install_py'
22 # directly, rather than going through 'install' -- so in reality,
23 # 'find_command_obj()' will create an 'install' command object,
24 # which we then query.
25
26 self.set_undefined_options ('install',
27 ('build_lib', 'build_dir'),
28 ('install_site_lib', 'dir'))
29
30 def run (self):
31
32 self.set_final_options ()
33
34 # Dump entire contents of the build directory to the installation
35 # directory (that's the beauty of having a build directory!)
Greg Ward4070f501999-04-04 02:46:29 +000036 self.copy_tree (self.build_dir, self.dir)
Greg Ward13ae1c81999-03-22 14:55:25 +000037
38 # run ()
39
40# class InstallPy