twisted.python.components.Adapter

Package twisted :: Package python :: Module components :: Class Adapter |
[frames | no frames]

## Class Adapter

Known Subclasses:
  `ConsumerToProtocolAdapter`, `InspectorNode`, `ManholeClient`, `ProtocolToConsumerAdapter`

I am the default implementation of an Adapter for some interface.

This docstring contains a limerick, by popular demand:

       Subclassing made Zope and TR
       much harder to work with by far.
           So before you inherit,
           be sure to declare it
       Adapter, not PyObject*

Method Summary
| ``__init__`(self, original)` Set my 'original' attribute to be the object I am adapting.
| ``getComponent`(self, interface, registry, default)` I forward getComponent to self.original if it has it, otherwise I simply return default.
| ``isuper`(self, iface, adapter)` Forward isuper to self.original

Class Variable Summary
`int` | `multiComponent`: If this adapter is persistent, should it be automatically registered for all appropriate interfaces.
`int` | `temporaryAdapter`: If this is True, the adapter will not be persisted on the Componentized.

Method Details

### __init__(self, original) (Constructor) Set my 'original' attribute to be the object I am adapting.

### getComponent(self, interface, registry=None, default=None) I forward getComponent to self.original if it has it, otherwise I simply return default.

### isuper(self, iface, adapter) Forward isuper to self.original

Class Variable Details

    ### multiComponent If this adapter is persistent, should it be automatically registered for all appropriate interfaces. Type: `int` Value:
        1

    ### temporaryAdapter If this is True, the adapter will not be persisted on the Componentized. Type: `int` Value:
        0

Generated by Epydoc 2.0 on Sat May 15 20:08:55 2004 | http://epydoc.sf.net