Package wx :: Package lib :: Module delayedresult :: Class PreProcessChain

[frames | no frames]

## Class PreProcessChain

Represent a 'delayed result pre-processing chain', a kind of Handler. Useful when lower-level objects need to apply a sequence of transformations to the delayed result before handing it over to a final handler. This allows the starter of the worker function to not know anything about the lower-level objects.

Method Summary
| ``__init__`(self, handler, *args, **kwargs)` Wrap handler(result, *args, **kwargs) so that the result it receives has been transformed by us.
| ``__call__`(self, delayedResult)` This makes us a Handler.
| ``addSub`(self, callable, *args, **kwargs)` Add a sub-callable, ie a callable(result, *args, **kwargs) that returns a transformed result to the previously added sub-callable (or the handler given at construction, if this is the first call to addSub).
| ``clone`(self)` Clone the chain.
| ``cloneAddSub`(self, callable, *args, **kwargs)` Convenience method that first clones self, then calls addSub() on that clone with given arguments.
| ``count`(self)` How many pre-processors in the chain

Method Details

### __init__(self, handler, *args, **kwargs)
(Constructor)

Wrap handler(result, *args, **kwargs) so that the result it receives has been transformed by us.

### __call__(self, delayedResult)
(Call operator)

This makes us a Handler. We just call handler(Traverser). The handler will think it is getting a delayed result, but in fact will be getting an instance of Traverser, which will take care of properly applying the chain of transformations to delayedResult.

### addSub(self, callable, *args, **kwargs)

Add a sub-callable, ie a callable(result, *args, **kwargs) that returns a transformed result to the previously added sub-callable (or the handler given at construction, if this is the first call to addSub).

### clone(self)

Clone the chain. Shallow only. Useful when several threads must be started but have different sub-callables.

### cloneAddSub(self, callable, *args, **kwargs)

Convenience method that first clones self, then calls addSub() on that clone with given arguments.

### count(self)

How many pre-processors in the chain

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:07:16 2007 | http://epydoc.sf.net