Repository navigation
Commit 8595ac5
committed
data: add anydata and anyxml support to print_dict
print_dict() skips anydata and anyxml nodes, so data created by
dict_to_dnode() since the previous commit does not show up.
Follow the libyang JSON printer: content stored as a tree becomes a
dict, a string value stays a string, and an empty node becomes an
empty dict. The output can then be given back to dict_to_dnode().
Note that the content is printed as is, so strip_prefixes does not
apply inside it. Also, anyxml XML content is parsed into a tree by
libyang, so it comes back as a dict and not as the XML string.
Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>1 parent 159117c commit 8595ac5
3 files changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1174 | 1174 | | |
1175 | 1175 | | |
1176 | 1176 | | |
| 1177 | + | |
1177 | 1178 | | |
1178 | 1179 | | |
1179 | 1180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
903 | 913 | | |
904 | 914 | | |
905 | 915 | | |
| |||
929 | 939 | | |
930 | 940 | | |
931 | 941 | | |
| 942 | + | |
| 943 | + | |
932 | 944 | | |
933 | 945 | | |
934 | 946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1209 | 1209 | | |
1210 | 1210 | | |
1211 | 1211 | | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
0 commit comments