Revision 216bb34c ncclient/operations/lock.py

b/ncclient/operations/lock.py
18 18

  
19 19
class Lock(RPC):
20 20

  
21
    "*<lock>* RPC"
22

  
21 23
    SPEC = {
22 24
        'tag': 'lock',
23 25
        'subtree': {
......
26 28
        }
27 29
    }
28 30

  
29
    def request(self, target, *args, **kwds):
31
    def request(self, target):
32
        """
33
        :arg target: see :ref:`source_target`
34
        :type target: string
35

  
36
        :rtype: :ref:`return`
37
        """
30 38
        spec = Lock.SPEC.copy()
31 39
        spec['subtree']['subtree']['tag'] = target
32
        return self._request(spec, *args, **kwds)
40
        return self._request(spec)
33 41

  
34 42

  
35 43
class Unlock(RPC):
36 44

  
45
    "*<unlock>* RPC"
46

  
37 47
    SPEC = {
38 48
        'tag': 'unlock',
39 49
        'subtree': {
......
42 52
        }
43 53
    }
44 54

  
45
    def request(self, target, *args, **kwds):
55
    def request(self, target):
56
        """
57
        :arg target: see :ref:`source_target`
58
        :type target: string
59

  
60
        :rtype: :ref:`return`
61
        """
46 62
        spec = Unlock.SPEC.copy()
47 63
        spec['subtree']['subtree']['tag'] = target
48
        return self._request(spec, *args, **kwds)
64
        return self._request(spec)
49 65

  
50 66

  
51 67
class LockContext:
52 68

  
69
    """
70
    A context manager for the :class:`Lock` / :class:`Unlock` pair of RPC's.
71

  
72
    Initialise with session instance (:class:`Session
73
    <ncclient.transport.Session>`) and lock target (:ref:`source_target`)
74
    """
75

  
53 76
    def __init__(self, session, target):
54 77
        self.session = session
55 78
        self.target = target

Also available in: Unified diff