Package kiwi :: Module component
[frames | no frames]

Module kiwi.component

Exceptions
AlreadyImplementedError Called when a utility already exists.

Function Summary
  get_utility(iface, default)
Get the utility for the named interface.
  provide_utility(iface, utility, replace)
Set the utility for the named interface.
  remove_utility(iface)
Remove the utility provided for an interface If the utility is not available (has not been set) {NotImplementedError} is raised.

Function Details

get_utility(iface, default=<class kiwi.ValueUnset at 0x402051dc>)

Get the utility for the named interface. If the utility is not available (has not been set) a {NotImplementedError} is raised unless default is set.
Parameters:
iface - an interface
default - optional, if set return if a utility is not found
Returns:
the utility

provide_utility(iface, utility, replace=False)

Set the utility for the named interface. If the utility is already set, an {AlreadyImplementedError} is raised.
Parameters:
iface - interface to set the utility for.
utility - utility providing the interface.

remove_utility(iface)

Remove the utility provided for an interface If the utility is not available (has not been set) {NotImplementedError} is raised.
Parameters:
iface - the interface
Returns:
the removed utility

Generated by Epydoc 2.1 on Tue Feb 6 10:53:33 2007 http://epydoc.sf.net