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

« back to all changes in this revision

Viewing changes to ivle/webapp/base/plugins.py

  • Committer: David Coles
  • Date: 2009-07-21 02:19:56 UTC
  • mto: (1281.1.8 aufsless)
  • mto: This revision was merged to the branch mainline in revision 1300.
  • Revision ID: coles.david@gmail.com-20090721021956-c1jiwu7fhi2dna1g
Updated to work on bind mounts

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
class ViewPlugin(BasePlugin):
27
27
    """Marker class for plugins that provide views.
28
28
 
29
 
    View plugins have three main types of registration:
30
 
     - forward_routes: A list of traversals from objects to their
31
 
       descendants. The discriminator is the source class and a list of zero
32
 
       or more intermediate path segments. An optional argument count may be
33
 
       given -- arguments will be taken from the path after the intermediate
34
 
       segments. The specified callable will be given the source object and
35
 
       any arguments, and should return the target object.
36
 
 
37
 
     - reverse_routes: A list of traversals from objects to their parents.
38
 
       The discriminator is just the child class. The provided callable must
39
 
       return a tuple of (parent_object, ('intermediate', path', 'segments')).
40
 
 
41
 
     - views: A list of named views for objects. The discriminator is the
42
 
       context object class, view name, and an optional view set. An optional
43
 
       (possibly infinite) argument count may again be given. The arguments
44
 
       values will be taken from the path after the view name. The callable
45
 
       should take the request object, target object and subpath, and return
46
 
       a view object.
47
 
 
48
 
    See ivle.dispatch.generate_publisher for the registry code.
 
29
    View plugins must have a 'urls' property which contains an iterable of pairs
 
30
    or triples, like (routex string, handler class, kwargs dict). The kwargs
 
31
    dict is optional. If present, the members of the kwargs dict will be passed
 
32
    as keyword arguments to the constructor of the view object.
49
33
 
50
34
    View plugins may also have a 'help' property, which should contain a dict
51
35
    of dicts and help file names. This dict is then used to generate the
63
47
    """Marker class for plugins that provide public mode views.
64
48
 
65
49
    Public view plugins can specify the same 'urls' property as normal view
66
 
    plugins, but they are added to the public mode publisher instead.
 
50
    plugins, but they are added to the public mode router instead.
67
51
    """
68
52
    pass
69
53