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

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: mattgiuca
  • Date: 2008-01-24 21:51:17 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:287
setup.py: Added new conf.py variable: subjects_base. This is for storing the
local path (note: to be a URL) to the subject directories where worksheet
content is stored.

apps/tutorial: Added some basic URL processing and code structure. 3
functions, for handling top-level menu, subject-level menu, and worksheet.
(stubs).

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
        jail_base = confmodule.jail_base
150
150
    except:
151
151
        jail_base = "/home/informatics/jails"
 
152
    try:
 
153
        subjects_base = confmodule.subjects_base
 
154
    except:
 
155
        subjects_base = "/home/informatics/subjects"
152
156
except ImportError:
153
157
    # Just set reasonable defaults
154
158
    root_dir = "/ivle"
155
159
    ivle_install_dir = "/opt/ivle"
156
160
    public_host = "public.localhost"
157
161
    jail_base = "/home/informatics/jails"
 
162
    subjects_base = "/home/informatics/subjects"
158
163
# Always defaults
159
164
allowed_uids = "0"
160
165
 
269
274
    --ivle_install_dir
270
275
    --public_host
271
276
    --jail_base
 
277
    --subjects_base
272
278
    --allowed_uids
273
279
As explained in the interactive prompt or conf.py.
274
280
"""
382
388
        file.write(']\n')
383
389
 
384
390
def conf(args):
385
 
    global root_dir, ivle_install_dir, jail_base, public_host, allowed_uids
 
391
    global root_dir, ivle_install_dir, jail_base, subjects_base
 
392
    global public_host, allowed_uids
386
393
    # Set up some variables
387
394
 
388
395
    cwd = os.getcwd()
423
430
        jail_base = query_user(jail_base,
424
431
        """Root directory where the jails (containing user files) are stored
425
432
(on the local file system):""")
 
433
        subjects_base = query_user(subjects_base,
 
434
        """Root directory where the subject directories (containing worksheets
 
435
and other per-subject files) are stored (on the local file system):""")
426
436
        public_host = query_user(public_host,
427
437
        """Hostname which will cause the server to go into "public mode",
428
438
providing login-free access to student's published work:""")
441
451
            ivle_install_dir = opts['--ivle_install_dir']
442
452
        if '--jail_base' in opts:
443
453
            jail_base = opts['--jail_base']
 
454
        if '--subjects_base' in opts:
 
455
            jail_base = opts['--subjects_base']
444
456
        if '--public_host' in opts:
445
457
            public_host = opts['--public_host']
446
458
        if '--allowed_uids' in opts:
486
498
# The user jails are expected to be located immediately in subdirectories of
487
499
# this location.
488
500
jail_base = "%s"
489
 
""" % (root_dir, ivle_install_dir, public_host, jail_base))
 
501
 
 
502
# In the local file system, where are the per-subject file spaces located.
 
503
# The individual subject directories are expected to be located immediately
 
504
# in subdirectories of this location.
 
505
subjects_base = "%s"
 
506
""" % (root_dir, ivle_install_dir, public_host, jail_base, subjects_base))
490
507
 
491
508
        conf.close()
492
509
    except IOError, (errno, strerror):