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

« back to all changes in this revision

Viewing changes to ivle/dispatch/__init__.py

ivle.dispatch: Change plugins_HACK spec such that it takes a sequence of
    strings, not tuples. The class name is now separated by a #.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
import plugins.console # XXX: Relies on www/ being in the Python path.
50
50
 
51
51
# XXX List of plugins, which will eventually be read in from conf
52
 
# Elements are (module, classname) pairs.
53
52
plugins_HACK = [
54
 
    ('ivle.webapp.admin.user', 'Plugin'),
55
 
    ('ivle.webapp.browser', 'Plugin'),
 
53
    'ivle.webapp.admin.user#Plugin',
 
54
    'ivle.webapp.browser#Plugin',
56
55
]
57
56
 
58
57
def get_routes_mapper():
61
60
    plugins config.
62
61
    """
63
62
    m = routes.Mapper()
64
 
    for plugin_path, classname in plugins_HACK:
 
63
    for pluginstr in plugins_HACK:
 
64
        plugin_path, classname = pluginstr.split('#')
65
65
        # Load the plugin module from somewhere in the Python path
66
66
        # (Note that plugin_path is a fully-qualified Python module name).
67
67
        plugin = getattr(__import__(plugin_path, fromlist=[classname]),