comparison MoinMoin/caching.py @ 463:051f79718bdd

fixing yet another bug in error logging calls imported from: moin--main--1.5--patch-467
author Thomas Waldmann <tw@waldmann-edv.de>
date Tue, 07 Mar 2006 07:05:29 +0000
parents 4110fdc3c1ff
children d6556513c4d3
comparison
equal deleted inserted replaced
462:361f1defc4c5 463:051f79718bdd
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 self.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 self.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 self.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