def __init__(self, func, cache_dir='', app_name='', cache_type='', idx=1,
                 expires=DEFAULT_EXPIRES):
        # type: (callable, str, str, str, Union[int, str, list], int) -> None
        """ Helper class for @fs_cache internals
        """
        self.func = func
        functools.update_wrapper(self, func)
        self.expires = expires
        # Will create a path:
        # <cache_dir>/<app_name>/<cache_type>/, omitting missing parts
        self.cache_path = mkdir(cache_dir or DEFAULT_PATH,
                                app_name and app_name + '.cache', cache_type)

        if isinstance(idx, int):
            # Python3 range objects won't work, so explicitly convert to list
            idx = list(range(idx))
        self.idx = idx
def __init__ ( self , func , cache_dir = '' , app_name = '' , cache_type = '' , idx = 1 , expires = DEFAULT_EXPIRES ) : self . func = func functools . update_wrapper ( self , func ) self . expires = expires self . cache_path = mkdir ( cache_dir or DEFAULT_PATH , app_name and app_name + '.cache' , cache_type ) if isinstance ( idx , int ) : idx = list ( range ( idx ) ) self . idx = idx
Helper class for @fs_cache internals