Package wtf :: Package app :: Package services :: Module memcache :: Class MemcacheDecorator
[hide private]
[frames] | no frames]

Class MemcacheDecorator

source code

        object --+    
                 |    
util.BaseDecorator --+
                     |
                    MemcacheDecorator

Memcache decorator
Instance Methods [hide private]
 
__init__(self, func, mcc, nocache=False, disabled=False)
Initialization
source code
any
__call__(self, *args, **kwargs)
Create a memcache connector or reuse a supplied one
source code

Inherited from util.BaseDecorator: __get__, __getattr__

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

Instance Variables [hide private]
MemcacheWrapper or Memcache _mc
Memcache connector

Inherited from util.BaseDecorator: __doc__, __name__

Inherited from util.BaseDecorator (private): _func

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, func, mcc, nocache=False, disabled=False)
(Constructor)

source code 
Initialization
Parameters:
  • func (callable) - The function to decorate
  • mcc (MemcacheWrapper or Memcache) - The memcache connector
  • nocache (int) - Nocache behavior
  • disabled (bool) - Is this decorator disabled?
Overrides: object.__init__

__call__(self, *args, **kwargs)
(Call operator)

source code 

Create a memcache connector or reuse a supplied one

The resulting connector is passed as a keyword argument into the decorated function.

Parameters:
  • args (tuple) - Function's positional arguments
  • kwargs (dict) - Function's keyword arguments
Returns: any
Whatever the decorated function returns
Raises:
  • Exception - Whatever the decorated function raises
Overrides: util.BaseDecorator.__call__