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

« back to all changes in this revision

Viewing changes to setup/util.py

Update some docs, and remove other obsolete ones.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
__all__ = ['PYTHON_VERSION', 'copy_file_to_jail', 'RunError',
35
35
           'action_runprog', 'action_remove', 'action_rename', 'action_mkdir',
36
36
           'action_copytree', 'action_copylist', 'action_copyfile',
37
 
           'action_symlink', 'action_chown',
 
37
           'action_symlink', 'action_append', 'action_chown',
38
38
           'action_chown_setuid', 'action_chmod_x', 'action_make_private',
39
 
           'filter_mutate', 'get_svn_revision', 'InstallList',
 
39
           'query_user', 'filter_mutate', 'get_svn_revision', 'InstallList',
40
40
           'make_install_path', 'wwwuid']
41
41
 
42
42
# Determine which Python version (2.4 or 2.5, for example) we are running,
195
195
    if not dry:
196
196
        os.symlink(src, dst)
197
197
 
 
198
def action_append(ivle_pth, ivle_www):
 
199
    file = open(ivle_pth, 'a+')
 
200
    file.write(ivle_www + '\n')
 
201
    file.close()
 
202
 
198
203
def action_chown_setuid(file, dry):
199
204
    """Chowns a file to root, and sets the setuid bit on the file.
200
205
    Calling this function requires the euid to be root.
291
296
    return os.path.join(rootdir, normpath)
292
297
 
293
298
class InstallList(object):
 
299
    # We build two separate lists, by walking www and console
 
300
    list_www = property(lambda self: build_list_py_files('www'))
 
301
 
294
302
    list_ivle_lib = property(lambda self: build_list_py_files('ivle'))
295
303
 
296
304
    list_subjects = property(lambda self: build_list_py_files('subjects',
321
329
        "bin/ivle-config",
322
330
        "bin/ivle-createdatadirs",
323
331
        "bin/ivle-buildjail",
324
 
        "bin/ivle-addexercise",
325
 
        "bin/ivle-cloneworksheets",
326
332
    ]