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

« back to all changes in this revision

Viewing changes to setup/build.py

  • Committer: Matt Giuca
  • Date: 2009-02-24 02:02:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1119.
  • Revision ID: matt.giuca@gmail.com-20090224020203-aqdcjnsj6y7wl32o
Added a new look to the IVLE header bar. Mmmm... Web 2.0.
Added top-level directory image-source, containing SVG and script files for
    generating the images.
ivle/webapp/coremedia/images: Added 'chrome' directory containing the rendered
    images.
Modified ivle/webapp/base/ivle-headings.html and
    ivle/webapp/coremedia/ivle.css to support the new images.
    Note that the H1 and H2 at the top of the page are no longer displayed
    (and their custom styles have been removed). There is a heading image
    instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    parser.add_option("--no-compile",
44
44
        action="store_true", dest="nocompile",
45
45
        help="Don't byte-compile .py files.")
 
46
    parser.add_option("-t", "--trampoline-uids",
 
47
        action="store", dest="tuids", default="33",
 
48
        help="Comma-separated list of UIDs allowed to use trampoline. "
 
49
             "(default: 33)")
46
50
    (options, args) = parser.parse_args(args)
47
51
 
48
52
    # Call the real function
49
 
    return __build(options.dry, options.nocompile)
 
53
    return __build(options.dry, options.nocompile, options.tuids)
50
54
 
51
 
def __build(dry=False, no_compile=None):
52
 
    # We need to import the one in the working copy, not in the system path.
53
 
    confmodule = __import__("ivle/conf/conf")
 
55
def __build(dry=False, no_compile=None, tuids=None):
54
56
    install_list = util.InstallList()
55
57
 
56
58
    if dry:
57
59
        print "Dry run (no actions will be executed)\n"
58
60
 
 
61
    # Create trampoline configuration.
 
62
    conf_hfile = os.path.join(os.getcwd(), "bin/trampoline/conf.h")
 
63
    conf_h = open(conf_hfile, "w")
 
64
 
 
65
    conf_h.write("""/* IVLE Configuration File
 
66
 * conf.h
 
67
 * Administrator settings required by trampoline.
 
68
 * Note: trampoline will have to be rebuilt in order for changes to this file
 
69
 * to take effect.
 
70
 */
 
71
 
 
72
#define IVLE_AUFS_JAILS
 
73
 
 
74
/* Which user IDs are allowed to run the trampoline.
 
75
 * This list should be limited to the web server user.
 
76
 * (Note that root is an implicit member of this list).
 
77
 */
 
78
static const int allowed_uids[] = { %s };
 
79
""" % tuids)
 
80
    conf_h.close()
 
81
 
59
82
    # Compile the trampoline
60
83
    curdir = os.getcwd()
61
84
    os.chdir('bin/trampoline')
70
93
 
71
94
    # Compile .py files into .pyc or .pyo files
72
95
    if not no_compile:
73
 
        compileall.compile_dir('www', quiet=True)
74
96
        compileall.compile_dir('ivle', quiet=True)
75
97
        compileall.compile_dir('services', quiet=True)
76
98