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

« back to all changes in this revision

Viewing changes to setup/install.py

  • Committer: Matt Giuca
  • Date: 2010-07-22 02:12:36 UTC
  • mfrom: (1812.1.13 late-submit)
  • Revision ID: matt.giuca@gmail.com-20100722021236-k8kt4cqdtywzpk24
Merge from trunk late-submit.
Students may now submit projects after the deadline, but they are warned that the submission is late.
Lecturers are now given data on which submissions were made late, and how many days.
(LP: #598346)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    parser.add_option("-n", "--dry",
43
43
        action="store_true", dest="dry",
44
44
        help="Print out the actions but don't do anything.")
45
 
    parser.add_option("-R", "--nosvnrevno",
46
 
        action="store_true", dest="nosvnrevno",
47
 
        help="Don't write out the Subversion revision to the share directory.")
48
45
    parser.add_option("--root",
49
46
        action="store", dest="rootdir",
50
47
        help="Install into a different root directory.",
76
73
    # Call the real function
77
74
    return __install(prefix=options.prefix,
78
75
                     python_site_packages=options.python_site_packages,
79
 
                     dry=options.dry, rootdir=options.rootdir,
80
 
                     nosvnrevno=options.nosvnrevno)
 
76
                     dry=options.dry, rootdir=options.rootdir)
81
77
 
82
 
def __install(prefix, python_site_packages, dry=False, rootdir=None,
83
 
              nosvnrevno=False):
 
78
def __install(prefix, python_site_packages, dry=False, rootdir=None):
84
79
    install_list = util.InstallList()
85
80
 
86
81
    # We need to apply make_install_path with the rootdir to an awful lot of
129
124
    # Copy the lib directory (using the list)
130
125
    util.action_copylist(install_list.list_ivle_lib, python_site_packages, dry)
131
126
 
132
 
    if not nosvnrevno:
133
 
        # Create the ivle working revision record file
134
 
        ivle_revision_file = os.path.join(share_path, 'revision.txt')
135
 
        if not dry:
136
 
            try:
137
 
                conf = open(ivle_revision_file, "w")
138
 
 
139
 
                conf.write("""# SVN revision r%s
140
 
# Source tree location: %s
141
 
# Modified files:
142
 
""" % (util.get_svn_revision(), os.getcwd()))
143
 
 
144
 
                conf.close()
145
 
            except IOError, (errno, strerror):
146
 
                print "IO error(%s): %s" % (errno, strerror)
147
 
                sys.exit(1)
148
 
 
149
 
            os.system("svn status . >> %s" % ivle_revision_file)
150
 
 
151
 
        print "Wrote IVLE code revision status to %s" % ivle_revision_file
152
 
 
153
127
    return 0
154
128