X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/194615a88fac0c4259b3c2217c8e13372b7c3b86..cd3cd96e2ff4c6e6a9a38393e4d93167d30f74ea:/lib/python/Components/Element.py diff --git a/lib/python/Components/Element.py b/lib/python/Components/Element.py index 437d934b..f4a8f127 100644 --- a/lib/python/Components/Element.py +++ b/lib/python/Components/Element.py @@ -8,13 +8,21 @@ from Tools.CList import CList def cached(f): name = f.__name__ def wrapper(self): - if self.cache is None: + cache = self.cache + if cache is None: return f(self) - if name not in self.cache: - self.cache[name] = (True, f(self)) - return self.cache[name][1] + if name not in cache: + cache[name] = (True, f(self)) + return cache[name][1] return wrapper +class ElementError(Exception): + def __init__(self, message): + self.message = message + + def __str__(self): + return self.message + class Element(object): CHANGED_DEFAULT = 0 # initial "pull" state CHANGED_ALL = 1 # really everything changed