Revision 4bc8021f ncclient/operations/retrieve.py
b/ncclient/operations/retrieve.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
class GetReply(RPCReply): |
22 | 22 |
|
23 |
"""Adds attributes for the *<data>* element to :class:`RPCReply`, which
|
|
24 |
pertains to the :class:`Get` and :class:`GetConfig` operations."""
|
|
23 |
"""Adds attributes for the *data* element to `RPCReply`. This pertains to the `Get` and
|
|
24 |
`GetConfig` operations.""" |
|
25 | 25 |
|
26 | 26 |
def _parsing_hook(self, root): |
27 | 27 |
self._data = None |
28 | 28 |
if not self._errors: |
29 | 29 |
self._data = root.find(qualify("data")) |
30 |
|
|
30 |
|
|
31 | 31 |
@property |
32 | 32 |
def data_ele(self): |
33 |
"*<data>* element as an :class:`~xml.etree.ElementTree.Element`"
|
|
33 |
"*data* element as an `~xml.etree.ElementTree.Element`"
|
|
34 | 34 |
if not self._parsed: |
35 | 35 |
self.parse() |
36 | 36 |
return self._data |
37 | 37 |
|
38 | 38 |
@property |
39 | 39 |
def data_xml(self): |
40 |
"*<data>* element as an XML string"
|
|
40 |
"*data* element as an XML string"
|
|
41 | 41 |
if not self._parsed: |
42 | 42 |
self.parse() |
43 | 43 |
return to_xml(self._data) |
44 | 44 |
|
45 |
#: Same as :attr:`data_ele` |
|
46 | 45 |
data = data_ele |
47 |
|
|
48 |
#def __repr__(self): |
|
49 |
# return self.data_xml |
|
46 |
"Same as :attr:`data_ele`" |
|
50 | 47 |
|
51 | 48 |
|
52 | 49 |
class Get(RPC): |
53 | 50 |
|
54 |
"The *<get>* RPC"
|
|
51 |
"The *get* RPC."
|
|
55 | 52 |
|
56 | 53 |
REPLY_CLS = GetReply |
57 | 54 |
|
... | ... | |
64 | 61 |
|
65 | 62 |
class GetConfig(RPC): |
66 | 63 |
|
67 |
"The *<get-config>* RPC"
|
|
64 |
"The *get-config* RPC."
|
|
68 | 65 |
|
69 | 66 |
REPLY_CLS = GetReply |
70 | 67 |
|
Also available in: Unified diff