(amount, *keywords)
| 32 | configVal = getattr(eos.config, "gamedataCache", None) |
| 33 | if configVal is True: |
| 34 | def cachedQuery(amount, *keywords): |
| 35 | def deco(function): |
| 36 | def checkAndReturn(*args, **kwargs): |
| 37 | useCache = kwargs.pop("useCache", True) |
| 38 | cacheKey = [] |
| 39 | cacheKey.extend(args) |
| 40 | for keyword in keywords: |
| 41 | cacheKey.append(kwargs.get(keyword)) |
| 42 | |
| 43 | cacheKey = tuple(cacheKey) |
| 44 | handler = cache.get(cacheKey) |
| 45 | if handler is None or not useCache: |
| 46 | handler = cache[cacheKey] = function(*args, **kwargs) |
| 47 | |
| 48 | return handler |
| 49 | |
| 50 | return checkAndReturn |
| 51 | |
| 52 | return deco |
| 53 | |
| 54 | elif callable(configVal): |
| 55 | cachedQuery = eos.config.gamedataCache |
nothing calls this directly
no outgoing calls
no test coverage detected