~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-22 02:04:13 UTC
  • Revision ID: grantw@unimelb.edu.au-20090422020413-v2lfi31t0fh5gxfu
Allow revocation of group memberships by tutors and lecturers.
(Google Code issue #143)

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