Revision b69684c3
b/src/__init__.py | ||
---|---|---|
18 | 18 |
class ncclientError(Exception): pass |
19 | 19 |
|
20 | 20 |
class NETCONFError(ncclientError): pass |
21 |
|
|
22 |
# Decorators |
|
23 |
|
|
24 |
def override(func): func |
b/src/session.py | ||
---|---|---|
50 | 50 |
# ... |
51 | 51 |
self._q.add(hello) |
52 | 52 |
|
53 |
@override |
|
54 | 53 |
def _close(self): |
55 | 54 |
raise NotImplementedError |
56 | 55 |
|
57 |
@override |
|
58 | 56 |
def connect(self): |
59 | 57 |
raise NotImplementedError |
60 |
|
|
61 | 58 |
|
62 | 59 |
def send(self, message): |
63 | 60 |
if self.ready: |
... | ... | |
67 | 64 |
|
68 | 65 |
### Thread methods |
69 | 66 |
|
70 |
@override |
|
71 | 67 |
def run(self): |
72 | 68 |
raise NotImplementedError |
73 | 69 |
|
... | ... | |
93 | 89 |
def get_capabilities(self, whose): |
94 | 90 |
return self._capabilities[whose] |
95 | 91 |
|
96 |
@property |
|
97 |
def ready(self): self._connected and self._initialised |
|
92 |
ready = property(lambda self: self._connected and self._initialised) |
|
98 | 93 |
|
99 |
@property |
|
100 |
def id(self): self._id |
|
94 |
id = property(lambda self: self._id) |
|
101 | 95 |
|
102 |
@property |
|
103 |
def client_capabilities(self): |
|
104 |
return self._capabilities[CLIENT] |
|
96 |
client_capabilities = property(lambda self: self._capabilities[CLIENT]) |
|
105 | 97 |
|
106 |
@property |
|
107 |
def server_capabilities(self): |
|
108 |
return self._capabilities[SERVER] |
|
98 |
server_capabilities = property(lambda self: self._capabilities[SERVER]) |
b/src/ssh.py | ||
---|---|---|
55 | 55 |
transport = self._client.get_transport() |
56 | 56 |
self._channel = transport.open_session() |
57 | 57 |
self._channel.invoke_subsystem('netconf') |
58 |
self.connected = True |
|
58 | 59 |
self._greet() |
59 | 60 |
self.start() |
60 | 61 |
|
Also available in: Unified diff