comparison MoinMoin/caching.py @ 3866:44275a3436eb

caching: minor changes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 16 Jul 2008 22:48:33 +0200
parents 4ffd618f2826
children f042906b346e
comparison
equal deleted inserted replaced
3865:4ffd618f2826 3866:44275a3436eb
246 self.close() 246 self.close()
247 except (pickle.PicklingError, OSError, IOError, ValueError), err: 247 except (pickle.PicklingError, OSError, IOError, ValueError), err:
248 raise CacheError(str(err)) 248 raise CacheError(str(err))
249 249
250 def content(self): 250 def content(self):
251 # no file-like api yet, we implement it when we need it
251 try: 252 try:
252 try: 253 try:
253 self.open(mode='r') 254 self.open(mode='r')
254 data = self.read() 255 data = self.read()
255 finally: 256 finally:
264 265
265 def remove(self): 266 def remove(self):
266 if not self.locking or self.locking and self.wlock.acquire(1.0): 267 if not self.locking or self.locking and self.wlock.acquire(1.0):
267 try: 268 try:
268 try: 269 try:
269 os.remove(self._filename()) 270 os.remove(self._fname)
270 except OSError: 271 except OSError:
271 pass 272 pass
272 finally: 273 finally:
273 if self.locking: 274 if self.locking:
274 self.wlock.release() 275 self.wlock.release()