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

« back to all changes in this revision

Viewing changes to setup/install.py

Move the plugin loading/indexing logic into ivle.config.Config.
Also eliminate plugins_HACK, looking in a configuration file instead.

req.config is now set to a Config instance, and things that need to look
at plugins ask it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
Create $target/bin.
36
36
Copy bin/trampoline/trampoline to $target/bin.
37
37
Copy bin/timount/timount to $target/bin.
 
38
Copy etc/ivle.conf to /etc/ivle/ivle.conf.
38
39
chown and chmod the installed trampoline.
 
40
Copy www/ to $target.
39
41
"""
40
42
 
41
43
    # Parse arguments
90
92
        return 1
91
93
 
92
94
    # Create the config directory.
93
 
    util.action_mkdir(mip('/etc/ivle/plugins.d'), dry)
 
95
    util.action_mkdir('/etc/ivle', dry)
94
96
 
95
97
    # Create lib and copy the compiled files there
96
98
    util.action_mkdir(lib_path, dry)
113
115
    util.action_copylist(install_list.list_user_binaries, bin_path, dry,
114
116
                         onlybasename=True)
115
117
 
 
118
    # Copy the www directory (using the list)
 
119
    util.action_copylist(install_list.list_www, share_path, dry)
 
120
 
 
121
    # Set appropriate permissions on the php directory
 
122
    forum_dir = "www/php/phpBB3"
 
123
    forum_path = os.path.join(share_path, forum_dir)
 
124
    print "chown -R www-data:www-data %s" % forum_path
 
125
    if not dry:
 
126
        os.system("chown -R www-data:www-data %s" % forum_path)
 
127
 
116
128
    # Copy the lib directory (using the list)
117
129
    util.action_copylist(install_list.list_ivle_lib, python_site_packages, dry)
118
130
 
 
131
    # XXX We shouldn't have ivle.pth at all any more.
 
132
    # We may still need the www packages to be importable.
 
133
    # Anything from www that is needed from the outside should go to lib.
 
134
    ivle_pth = os.path.join(python_site_packages, "ivle.pth")
 
135
    try:
 
136
        file = open(ivle_pth, 'w')
 
137
        file.write(os.path.join(share_path, "www"))
 
138
        file.close()
 
139
    except (IOError, OSError):
 
140
        pass
 
141
 
119
142
    if not nosvnrevno:
120
143
        # Create the ivle working revision record file
121
144
        ivle_revision_file = os.path.join(share_path, 'revision.txt')