~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-07-05 03:17:19 UTC
  • mto: (1294.4.2 ui-the-third)
  • mto: This revision was merged to the branch mainline in revision 1353.
  • Revision ID: grantw@unimelb.edu.au-20090705031719-5hl9df990of50nly
Add annotated route function support to ivle.dispatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
    for plugin in view_plugins:
63
63
        if hasattr(plugin, 'forward_routes'):
64
64
            for fr in plugin.forward_routes:
65
 
                r.add_forward(*fr)
 
65
                # An annotated function can also be passed in directly.
 
66
                if hasattr(fr, '_forward_route_meta'):
 
67
                    r.add_forward_func(fr)
 
68
                else:
 
69
                    r.add_forward(*fr)
 
70
 
 
71
        if hasattr(plugin, 'reverse_routes'):
 
72
            for rr in plugin.reverse_routes:
 
73
                # An annotated function can also be passed in directly.
 
74
                if hasattr(rr, '_reverse_route_src'):
 
75
                    r.add_reverse_func(rr)
 
76
                else:
 
77
                    r.add_reverse(*rr)
66
78
 
67
79
        if hasattr(plugin, 'views'):
68
80
            for v in plugin.views: