mirror of
https://github.com/grahampugh/macadmin-scripts.git
synced 2025-12-17 17:56:33 +00:00
Handle nested dict elem within auxinfo
- this is present in 091-33271 (10.13.2, build 17C2120)
This commit is contained in:
parent
7de1ecab2b
commit
397469774f
@ -218,7 +218,15 @@ def parse_dist(filename):
|
|||||||
auxinfo = auxinfos[0]
|
auxinfo = auxinfos[0]
|
||||||
key = None
|
key = None
|
||||||
value = None
|
value = None
|
||||||
for node in auxinfo.childNodes:
|
children = auxinfo.childNodes
|
||||||
|
# handle the possibility that keys from auxinfo may be nested
|
||||||
|
# within a 'dict' element
|
||||||
|
dict_nodes = [n for n in auxinfo.childNodes
|
||||||
|
if n.nodeType == n.ELEMENT_NODE and
|
||||||
|
n.tagName == 'dict']
|
||||||
|
if dict_nodes:
|
||||||
|
children = dict_nodes[0].childNodes
|
||||||
|
for node in children:
|
||||||
if node.nodeType == node.ELEMENT_NODE and node.tagName == 'key':
|
if node.nodeType == node.ELEMENT_NODE and node.tagName == 'key':
|
||||||
key = node.firstChild.wholeText
|
key = node.firstChild.wholeText
|
||||||
if node.nodeType == node.ELEMENT_NODE and node.tagName == 'string':
|
if node.nodeType == node.ELEMENT_NODE and node.tagName == 'string':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user