comparison MoinMoin/wikiutil.py @ 1111:2aa53ed0afa0

Fix the unrespected cache_dir problem.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Mon, 31 Jul 2006 11:20:22 +0200
parents 75f8c432385f
children 2be8ec7ba817
comparison
equal deleted inserted replaced
1100:a60c236bf0ac 1111:2aa53ed0afa0
409 409
410 class MetaDict(dict): 410 class MetaDict(dict):
411 """ store meta informations as a dict. 411 """ store meta informations as a dict.
412 XXX It is not thread-safe, add locks! 412 XXX It is not thread-safe, add locks!
413 """ 413 """
414 def __init__(self, metafilename): 414 def __init__(self, metafilename, cache_directory):
415 """ create a MetaDict from metafilename """ 415 """ create a MetaDict from metafilename """
416 dict.__init__(self) 416 dict.__init__(self)
417 self.metafilename = metafilename 417 self.metafilename = metafilename
418 self.dirty = False 418 self.dirty = False
419 self.loaded = False 419 self.loaded = False
420 lock_dir = os.path.normpath(os.path.join(metafilename, '..', 'cache', '__metalock__')) 420 lock_dir = os.path.join(cache_directory, '__metalock__')
421 self.rlock = lock.ReadLock(lock_dir, 60.0) 421 self.rlock = lock.ReadLock(lock_dir, 60.0)
422 self.wlock = lock.WriteLock(lock_dir, 60.0) 422 self.wlock = lock.WriteLock(lock_dir, 60.0)
423 423
424 def _get_meta(self): 424 def _get_meta(self):
425 """ get the meta dict from an arbitrary filename. 425 """ get the meta dict from an arbitrary filename.