Package grassyknoll :: Package concurrent :: Module Wrappers :: Class FactoryContextManager
[hide private]

Class FactoryContextManager

source code


a context manager for working with factories.

factory will be called and should return an object with a close method, which will be called from __exit__.

decorators is a list of functions applied in natural order (ie, right-to-left) to the object. The return value of the final decorator will be returned from __enter__.

Instance Methods [hide private]
 
__init__(self, factory, more_decorators)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__enter__(self) source code
 
__exit__(self, type, value, traceback) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Methods [hide private]

Inherited from lib.meta.FactoryMixin: factory

Class Variables [hide private]
list of decorators default_decorators = []
a default set of decorators specified by subclasses.
Instance Variables [hide private]
list decorators
a list of decorators to apply the object
instance obj
the object
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, factory, more_decorators)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Parameters:
  • factory (factory) - a factory returning an object to be managed
  • more_decorators (list of decorators) - more decorators to apply to the object. These are applied after default_decorators.
Overrides: object.__init__

Class Variable Details [hide private]

default_decorators

a default set of decorators specified by subclasses. These are applied before more_decorators.
Type:
list of decorators
Value:
[]