Revision 216bb34c ncclient/transport/session.py

b/ncclient/transport/session.py
22 22
logger = logging.getLogger('ncclient.transport.session')
23 23

  
24 24
class Session(Thread):
25

  
25 26
    "Base class for use by transport protocol implementations."
26 27

  
27 28
    def __init__(self, capabilities):
......
86 87
        self.remove_listener(listener)
87 88
        if error[0]:
88 89
            raise error[0]
90
        #if ':base:1.0' not in self.server_capabilities:
91
        #    raise MissingCapabilityError(':base:1.0')
89 92
        logger.info('initialized: session-id=%s | server_capabilities=%s' %
90 93
                    (self._id, self._server_capabilities))
91 94

  
......
93 96
        """Register a listener that will be notified of incoming messages and
94 97
        errors.
95 98

  
96
        :arg listener: :class:`SessionListener`
99
        :type listener: :class:`SessionListener`
97 100
        """
98 101
        logger.debug('installing listener %r' % listener)
99 102
        if not isinstance(listener, SessionListener):
......
103 106

  
104 107
    def remove_listener(self, listener):
105 108
        """Unregister some listener; ignore if the listener was never
106
        registered."""
109
        registered.
110

  
111
        :type listener: :class:`SessionListener`
112
        """
107 113
        logger.debug('discarding listener %r' % listener)
108 114
        with self._lock:
109 115
            self._listeners.discard(listener)
110 116

  
111 117
    def get_listener_instance(self, cls):
112
        """If a listener of the sspecified type is registered, returns the
113
        instance. This is useful when it is desirable to have only one instance
114
        of a particular type per session, i.e. a multiton.
118
        """If a listener of the specified type is registered, returns the
119
        instance.
115 120

  
116
        :arg cls: class of the listener
121
        :type cls: :class:`SessionListener`
117 122
        """
118 123
        with self._lock:
119 124
            for listener in self._listeners:
......
131 136

  
132 137
        :arg message: an XML document
133 138

  
134
        :type message: :obj:`string`
139
        :type message: `string`
135 140
        """
136 141
        logger.debug('queueing %s' % message)
137 142
        self._q.put(message)
......
155 160

  
156 161
    @property
157 162
    def id(self):
158
        """A :obj:`string` representing the `session-id`. If the session has not
163
        """A `string` representing the `session-id`. If the session has not
159 164
        been initialized it will be :const:`None`"""
160 165
        return self._id
161 166

  
......
180 185
        document.
181 186

  
182 187
        :arg root: is a tuple of `(tag, attributes)` where `tag` is the qualified name of the root element and `attributes` is a dictionary of its attributes (also qualified names)
188
        :type root: `tuple`
183 189

  
184 190
        :arg raw: XML document
185
        :type raw: :obj:`string`
191
        :type raw: `string`
186 192
        """
187 193
        raise NotImplementedError
188 194

  

Also available in: Unified diff