PrCX L d Z ddlmZ ddlmZ i Zdaed Zd Zd Z dS ) aO This is a simple wrapper around lru_cache which allows us to enable caching only within some scope defined by contextmanager It makes it easier to cache some functions e.g. only inside wpos-user get scope and still be able to get fresh data in wpos-user enable where cached commands might return different results because of outside )contextmanager) lru_cacheFc # K t rt d da dV t da dS # t da w xY w)zK This context manager sets global marker which enables caching znested scopes are not supportedTNF)CACHING_ENABLEDRuntimeError_clear_cache py/clwpos/scoped_cache.pyenable_cachingr sa ><=== s 2 Ac f t D ]} | dS )z1 Clear cache of all registered functions N)_CACHED_FUNCTIONSvaluescache_clear)funcs r r r " s> "((** r c ^ fd} t }|t j <