Files
python-build/pythonbrew/commands/install.py
T
2011-04-01 01:28:17 +09:00

55 lines
1.6 KiB
Python

from pythonbrew.basecommand import Command
from pythonbrew.log import logger
from pythonbrew.installer import PythonInstaller
class InstallCommand(Command):
name = "install"
usage = "%prog [OPTIONS] VERSION"
summary = "Build and install the given version of python"
def __init__(self):
super(InstallCommand, self).__init__()
self.parser.add_option(
"-f", "--force",
dest="force",
action="store_true",
default=False,
help="Force install of python.(skip make test)"
)
self.parser.add_option(
"-C", "--configure",
dest="configure",
default="",
metavar="CONFIGURE_OPTIONS",
help="Options passed directly to configure."
)
self.parser.add_option(
"-n", "--no-setuptools",
dest="no_setuptools",
action="store_true",
default=False,
help="Skip install of setuptools."
)
self.parser.add_option(
"--as",
dest="alias",
default=None,
help="Install a python under an alias."
)
self.parser.add_option(
'-j', "--jobs",
dest="jobs",
type='int',
default=0,
help="Enable parallel make."
)
def run_command(self, options, args):
if args:
# Install Python
PythonInstaller(args[0], options).install()
else:
logger.info("Unknown python version.")
InstallCommand()