Package twisted :: Package python :: Module components
[show private | hide private]
[frames | no frames]

Module twisted.python.components

Component architecture for Twisted.
Classes
Interface Base class for interfaces.
Componentized I am a mixin to allow you to be adapted in various ways persistently.
Adapter I am the default implementation of an Adapter for some interface.
_default  
_Nothing  

Function Summary
  implements(obj, interfaceClass)
Return boolean indicating if obj implements the given interface.
  getInterfaces(obj)
Return list of all interfaces a class implements.
  superInterfaces(interface)
Given an interface, return list of super-interfaces (including itself).
  registerAdapter(adapterClass, origClass, interfaceClass)
Register an adapter class.
  getAdapterClass(klass, interfaceClass, default)
Return registered adapter for a given class and interface.
  getAdapter(obj, interfaceClass, default, adapterClassLocator)
Return an object that implements the given interface.
  getAdapterClassWithInheritance(klass, interfaceClass, default)
Return registered adapter for a given class and interface.
  tupleTreeToList(t, l)
Convert an instance, or tree of tuples, into list.

Variable Summary
dict adapterRegistry

Function Details

getAdapter(obj, interfaceClass, default=<class twisted.python.components._default at..., adapterClassLocator=None)

Return an object that implements the given interface.

The result will be a wrapper around the object passed as a paramter, or the parameter itself if it already implements the interface. If no adapter can be found, the 'default' parameter will be returned.

getAdapterClass(klass, interfaceClass, default)

Return registered adapter for a given class and interface.

getAdapterClassWithInheritance(klass, interfaceClass, default)

Return registered adapter for a given class and interface.

getInterfaces(obj)

Return list of all interfaces a class implements.

implements(obj, interfaceClass)

Return boolean indicating if obj implements the given interface.

registerAdapter(adapterClass, origClass, interfaceClass)

Register an adapter class.

An adapter class is expected to implement the given interface, by adapting instances of paramter 'origClass'. An adapter class's __init__ method should accept one parameter, an instance of 'origClass'.

superInterfaces(interface)

Given an interface, return list of super-interfaces (including itself).

tupleTreeToList(t, l=None)

Convert an instance, or tree of tuples, into list.

Variable Details

adapterRegistry

Type:
dict
Value:
{(<class twisted.web.static.File at 0x10244d30>, <class twisted.coil.c\
oil.IConfigurator at 0x1027ae20>): <class twisted.coil.plugins.web.Sta\
ticConfigurator at 0x10517c18>,
 (<class twisted.web.static.File at 0x10244d30>, <class twisted.coil.c\
oil.ICollection at 0x10297010>): <class twisted.coil.plugins.web.Stati\
cConfigurator at 0x10517c18>,
 (<class twisted.internet.defer.Deferred at 0x10247408>, <class twiste\
d.web.woven.interfaces.IModel at 0x108832c0>): <class twisted.web.wove\
...                                                                    

Generated by Epydoc 1.2 prerelease on Wed Jan 29 06:28:35 2003 http://epydoc.sf.net