From c4cb35c30579d9c97dbda11ce29cbaa77ee0e2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 6 Jun 2009 22:42:06 +0200 Subject: [PATCH] Use _name for Cache instead of name to work with Cacheable for issue1076 --- trytond/tools/misc.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trytond/tools/misc.py b/trytond/tools/misc.py index 19811a087c..e567a5e6aa 100644 --- a/trytond/tools/misc.py +++ b/trytond/tools/misc.py @@ -260,7 +260,7 @@ class Cache(object): self.max_len = max_len self._cache = {} self._cache_instance.append(self) - self.name = name + self._name = name self.timestamp = None self.lock = Lock() @@ -271,7 +271,7 @@ class Cache(object): result = None find = False if isinstance(cursor, basestring): - Cache.reset(cursor, self.name) + Cache.reset(cursor, self._name) self.lock.acquire() try: self._cache[cursor] = {} @@ -352,9 +352,9 @@ class Cache(object): cursor.commit() cursor.close() for obj in Cache._cache_instance: - if obj.name in timestamps: - if not obj.timestamp or timestamps[obj.name] > obj.timestamp: - obj.timestamp = timestamps[obj.name] + if obj._name in timestamps: + if not obj.timestamp or timestamps[obj._name] > obj.timestamp: + obj.timestamp = timestamps[obj._name] obj.lock.acquire() try: obj._cache[dbname] = {}