diff --git a/client-barcode/freitagskasse.py b/client-barcode/freitagskasse.py index 48330b8..14deba5 100644 --- a/client-barcode/freitagskasse.py +++ b/client-barcode/freitagskasse.py @@ -56,6 +56,7 @@ def error_page(message): class Status: def __init__(self): self._reset() + self.item_cache = dict() def _reset(self): self.auth_blob = None @@ -122,7 +123,12 @@ class Status: self._reset() def find(self, item_id): - return net.get_item(item_id) + try: + return self.item_cache[item_id] + except KeyError: + item = net.get_item(item_id) + self.item_cache[item_id] = item + return item def buy(self, item): assert(self.logged_in())