comparison MoinMoin/caching.py @ 458:4110fdc3c1ff

fixing some wrong attribute references imported from: moin--main--1.5--patch-462
author Thomas Waldmann <tw@waldmann-edv.de>
date Sun, 26 Feb 2006 23:55:12 +0000
parents 481c432b3d11
children 051f79718bdd
comparison
equal deleted inserted replaced
457:f423a8496ae3 458:4110fdc3c1ff
80 pass 80 pass
81 finally: 81 finally:
82 if locking: 82 if locking:
83 self.wlock.release() 83 self.wlock.release()
84 else: 84 else:
85 request.log("Can't acquire write lock in %s", self.lock_dir) 85 self.request.log("Can't acquire write lock in %s", self.lock_dir)
86 86
87 def update(self, content, encode=False): 87 def update(self, content, encode=False):
88 if encode: 88 if encode:
89 content = content.encode(config.charset) 89 content = content.encode(config.charset)
90 if not locking or locking and self.wlock.acquire(1.0): 90 if not locking or locking and self.wlock.acquire(1.0):
98 pass 98 pass
99 finally: 99 finally:
100 if locking: 100 if locking:
101 self.wlock.release() 101 self.wlock.release()
102 else: 102 else:
103 request.log("Can't acquire write lock in %s", self.lock_dir) 103 self.request.log("Can't acquire write lock in %s", self.lock_dir)
104 104
105 def remove(self): 105 def remove(self):
106 try: 106 try:
107 os.remove(self._filename()) 107 os.remove(self._filename())
108 except OSError: 108 except OSError:
116 f.close() 116 f.close()
117 finally: 117 finally:
118 if locking: 118 if locking:
119 self.rlock.release() 119 self.rlock.release()
120 else: 120 else:
121 request.log("Can't acquire read lock in %s", self.lock_dir) 121 self.request.log("Can't acquire read lock in %s", self.lock_dir)
122 if decode: 122 if decode:
123 data = data.decode(config.charset) 123 data = data.decode(config.charset)
124 return data 124 return data
125 125