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.

Variable Summary
_UtilityHandler utilities = <kiwi.component._UtilityHandler object at 0x...

Function Details

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

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

Variable Details

utilities

Type:
_UtilityHandler
Value:
<kiwi.component._UtilityHandler object at 0x4117f2ec>                  

Generated by Epydoc 2.1 on Fri Mar 23 15:56:56 2007 http://epydoc.sf.net