~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to setup/install.py

  • Committer: William Grant
  • Date: 2009-04-28 08:25:30 UTC
  • Revision ID: grantw@unimelb.edu.au-20090428082530-u6w762gn0cyokpwf
Remove ivle.conf dependency from ivle.webapp.filesystem.serve.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import os
24
24
import sys
25
25
import functools
 
26
import distutils.sysconfig
26
27
 
27
28
from setup import util
28
29
 
29
 
PYTHON_VERSION = sys.version[:3]
30
 
 
31
30
def install(args):
32
31
    usage = """usage: %prog install [options]
33
32
(Requires root)
57
56
    parser.add_option("--python-site-packages",
58
57
        action="store", dest="python_site_packages",
59
58
        help="Path to Python site packages directory.",
60
 
        default='/usr/local/lib/python%s/site-packages' % PYTHON_VERSION)
 
59
        default=None)
61
60
    (options, args) = parser.parse_args(args)
62
61
 
 
62
    # Prefix must be absolute (not really necessary, but since a relative
 
63
    # prefix will be taken relative to *root* not working directory, it is
 
64
    # confusing if we allow it).
 
65
    if options.prefix[:1] not in (os.path.sep, os.path.altsep):
 
66
        print >>sys.stderr, """prefix must be an absolute path.
 
67
    (This will be interpreted relative to root, so provide --root=. if you
 
68
    want a path relative to the working directory)."""
 
69
        return 1
 
70
 
 
71
    # Calculate python_site_packages using the supplied prefix
 
72
    if options.python_site_packages is None:
 
73
        options.python_site_packages = distutils.sysconfig.get_python_lib(
 
74
            prefix=options.prefix)
 
75
 
63
76
    # Call the real function
64
77
    return __install(prefix=options.prefix,
65
78
                     python_site_packages=options.python_site_packages,