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

« back to all changes in this revision

Viewing changes to ivle/dispatch/__init__.py

  • Committer: William Grant
  • Date: 2009-12-02 04:02:19 UTC
  • mto: This revision was merged to the branch mainline in revision 1353.
  • Revision ID: grantw@unimelb.edu.au-20091202040219-z2qumlxdkmestikd
Use a different set of routes for public mode, too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
 
85
85
    if publicmode:
86
86
        view_attr = 'public_views'
 
87
        forward_route_attr = 'public_forward_routes'
 
88
        reverse_route_attr = 'public_reverse_routes'
87
89
    else:
88
90
        view_attr = 'views'
 
91
        forward_route_attr = 'forward_routes'
 
92
        reverse_route_attr = 'reverse_routes'
 
93
 
89
94
 
90
95
    for plugin in view_plugins:
91
 
        if hasattr(plugin, 'forward_routes'):
92
 
            for fr in plugin.forward_routes:
 
96
        if hasattr(plugin, forward_route_attr):
 
97
            for fr in getattr(plugin, forward_route_attr):
93
98
                # An annotated function can also be passed in directly.
94
99
                if hasattr(fr, '_forward_route_meta'):
95
100
                    r.add_forward_func(fr)
96
101
                else:
97
102
                    r.add_forward(*fr)
98
103
 
99
 
        if hasattr(plugin, 'reverse_routes'):
100
 
            for rr in plugin.reverse_routes:
 
104
        if hasattr(plugin, reverse_route_attr):
 
105
            for fr in getattr(plugin, reverse_route_attr):
101
106
                # An annotated function can also be passed in directly.
102
107
                if hasattr(rr, '_reverse_route_src'):
103
108
                    r.add_reverse_func(rr)