Revision 6bd810f9
b/ncclient/content.py | ||
---|---|---|
16 | 16 |
|
17 | 17 |
from xml.etree import cElementTree as ET |
18 | 18 |
|
19 |
################################################################################ |
|
20 |
# Namespace-related
|
|
19 |
|
|
20 |
### Namespace-related ###
|
|
21 | 21 |
|
22 | 22 |
BASE_NS = 'urn:ietf:params:xml:ns:netconf:base:1.0' |
23 | 23 |
|
... | ... | |
39 | 39 |
|
40 | 40 |
unqualify = lambda tag: tag[tag.rfind('}')+1:] |
41 | 41 |
|
42 |
################################################################################ |
|
43 |
# Build XML using Python data structures :-)
|
|
42 |
|
|
43 |
### Build XML using Python data structures :-) ###
|
|
44 | 44 |
|
45 | 45 |
class TreeBuilder: |
46 | 46 |
"""Build an ElementTree.Element instance from an XML tree specification |
... | ... | |
82 | 82 |
return ET.Comment(spec.get('comment')) |
83 | 83 |
else: |
84 | 84 |
raise ValueError('Invalid tree spec') |
85 |
|
|
86 |
################################################################################ |
Also available in: Unified diff