Store

class methodcache.store.Store(ttl=60)[source]
get_all_categorys()[source]

List of all categories on root level

Returns:
get_category(*category_tuple, full=False)[source]

GoTo category level given in category_tuple and return this level content :param category_tuple: List of Categorys :param full: return the full cateogry not only the names :return:

get_method_store(*category)[source]

Get the MethodStore from category/subcategory If no methodstore exists, create a new one

Parameters:category – list of category and thier subcategorys
Return MethodStore:
 Return new or old MethodStore Object
class methodcache.store.MethodStore(store, *args, **kwargs)[source]
create(func, params, result)[source]

Create a new Cache Entry

Parameters:
  • func – WrappedFunction for wich function the entry created
  • params – WrappedParameter which parameters used to get this result
  • result – string Result
get_method(func, params)[source]

Returns the MethodObject identified by func and params

Parameters:
  • func – WrappedFunction Object to identifiy search method
  • params – WrappedParameters Object to check if a object with this parameters is stored
Return MethodObject:
 

the MethodObject with the cache Information

has_method(func)[source]

Check if function is stored in this MethodStore Object

Parameters:func – WrapperFunction with the searched funciton
Return bool:True if method existes in this store
has_method_call(func, params)[source]

Like has_method. This Checks also if a method with the given arguments exists

Parameters:
  • func – WrapperFunction contains the function
  • params – WrapperParameters contains arguments and keyword arguments
Return bool:

True if method call exists and stored in this MEthodStore

class methodcache.store.MethodObject(func, params, result)[source]
has_params__exactly(params)[source]

Check if the Parameters are excatly the same wich are given as argument :param params: WrapperParameters to compare :return bool: True if the params are the same