~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lock.py

  • Committer: Robert Collins
  • Date: 2009-03-12 06:24:39 UTC
  • mto: This revision was merged to the branch mainline in revision 4133.
  • Revision ID: robertc@robertcollins.net-20090312062439-gigl7rnor6t2cbcz
Migrate existing hooks over to the new HookPoint infrastructure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    osutils,
43
43
    trace,
44
44
    )
45
 
from bzrlib.hooks import Hooks
 
45
from bzrlib.hooks import HookPoint, Hooks
46
46
 
47
47
 
48
48
class LockHooks(Hooks):
49
49
 
50
50
    def __init__(self):
51
51
        Hooks.__init__(self)
52
 
 
53
 
        # added in 1.8; called with a LockResult when a physical lock is
54
 
        # acquired
55
 
        self['lock_acquired'] = []
56
 
 
57
 
        # added in 1.8; called with a LockResult when a physical lock is
58
 
        # acquired
59
 
        self['lock_released'] = []
 
52
        self.create_hook(HookPoint('lock_acquired',
 
53
            "Called with a bzrlib.lock.LockResult when a physical lock is "
 
54
            "acquired.", (1, 8), None))
 
55
        self.create_hook(HookPoint('lock_released',
 
56
            "Called with a bzrlib.lock.LockResult when a physical lock is "
 
57
            "released.", (1, 8), None))
60
58
 
61
59
 
62
60
class Lock(object):