Parameters: |
- prio (number) – specifies a priority in which order of precedence the
lookup callback should be called. Lesser has more
precedence. If prio is None, don’t register the
callback in the lookup registry but, only if the
backend argument is present, in the backends lookup
registry.
- method (string) – Specifies for which lookup method the callback
should be registered.
Valid values are: ‘I{get}’, ‘I{iter}’,
‘I{in}’, ‘I{nodeType}’, ‘I{init}’
The respective method’s will be triggered by the
respective real DataSource methods L{<DataSource.get>},
L{DataSource.__iter__} and
L{DataSource.__contains__}.
- cb (function) –
Specifies the callback function to be called when this
method triggers. The function needs to have the following
format:
C{method(key, obj, res)}
where I{key} will be the value of the key called by
the lookup method (where it makes sense)
and I{obj} points to the L{<DataSource>} object from
where the method has been called. This way the lookup
methods have access to the entire DataSource tree.
I{res} specifies a dict resource to which the
callback may access in order to store data forth for
following lookup iterations
- typefilter (string) – if supplied, causes the callback to
trigger only if the key for which the
lookup callback should be triggered is
of the specified node-type.
Valid values are ‘I{node}’, ‘I{leaf}’ and ‘I{*}’
Default is ‘I{*}’, which means apply to any
type.
- keyfilter (string) – if supplied, causes the callback to
trigger only if the key for which the
lookup callback should be triggered is
same as the value of keyfilter.
A value of ‘I{*}’ means, apply to any key.
‘I{*}’ is the default.
- backend (string) – backend name, if supplied register the callback for
the given backend/method
|