# Module k.component

Part of kiwi

No module docstring

Class | Interface | Undocumented
Class | Attribute | Undocumented
Function | implements | Undocumented
Class | AlreadyImplementedError | Called when a utility already exists.
Class | _UtilityHandler | Undocumented
Function | provide_utility | Set the utility for the named interface. If the utility is already
Function | get_utility | Get the utility for the named interface. If the utility is not
Function | remove_utility | Remove the utility provided for an interface

def implements(iface):
Undocumented
def 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.

def get_utility(iface, default=ValueUnset):
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

def 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