Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cachier/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,19 @@ def func_wrapper(*args, **kwds):
_print("No entry found. No current calc. Calling like a boss.")
return _calc_entry(core, key, func, args, kwds)

def clear_cache():
def _clear_cache():
"""Clear the cache."""
core.clear_cache()

def clear_being_calculated():
def _clear_being_calculated():
"""Marks all entries in this cache as not being calculated."""
core.clear_being_calculated()

def cache_dpath():
def _cache_dpath():
"""Returns the path to the cache dir, if exists; None if not."""
return getattr(core, "cache_dir", None)

def precache_value(*args, value_to_cache, **kwds):
def _precache_value(*args, value_to_cache, **kwds):
"""Add an initial value to the cache.

Arguments
Expand All @@ -295,10 +295,10 @@ def precache_value(*args, value_to_cache, **kwds):
)
return core.precache_value(tuple(), kwargs, value_to_cache)

func_wrapper.clear_cache = clear_cache
func_wrapper.clear_being_calculated = clear_being_calculated
func_wrapper.cache_dpath = cache_dpath
func_wrapper.precache_value = precache_value
func_wrapper.clear_cache = _clear_cache
func_wrapper.clear_being_calculated = _clear_being_calculated
func_wrapper.cache_dpath = _cache_dpath
func_wrapper.precache_value = _precache_value
return func_wrapper

return _cachier_decorator