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

« back to all changes in this revision

Viewing changes to setup/util.py

Remove the setup.configure import from setup.

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.
256
261
# Mime types which will automatically be placed in the list by InstallList.
257
262
installlist_mimetypes = ['text/x-python', 'text/html',
258
263
    'application/x-javascript', 'application/javascript',
259
 
    'text/css', 'image/png', 'image/gif', 'application/xml', 'text/plain']
 
264
    'text/css', 'image/png', 'image/gif', 'application/xml']
260
265
# Filenames which will automatically be placed in the list by InstallList.
261
266
whitelist_filenames = ['ivle-spec.conf']
262
267
 
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',
303
311
        "services/python-console",
304
312
        "services/fileservice",
305
313
        "services/serveservice",
 
314
        "services/interpretservice",
306
315
        "services/usrmgt-server",
307
316
        "services/diffservice",
308
317
        "services/svnlogservice",
312
321
    list_user_binaries = [
313
322
        "bin/ivle-enrol",
314
323
        "bin/ivle-enrolallusers",
315
 
        "bin/ivle-fetchsubmissions",
316
324
        "bin/ivle-listusers",
317
325
        "bin/ivle-makeuser",
318
326
        "bin/ivle-marks",
319
327
        "bin/ivle-mountallusers",
320
328
        "bin/ivle-remakeuser",
321
329
        "bin/ivle-showenrolment",
322
 
        "bin/ivle-config",
323
 
        "bin/ivle-createdatadirs",
324
330
        "bin/ivle-buildjail",
325
 
        "bin/ivle-addexercise",
326
 
        "bin/ivle-cloneworksheets",
327
 
        "bin/ivle-refreshfilesystem",
328
331
    ]